From 9bde653410e83d5e97729aef212341f3cde790bc Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Sun, 20 Mar 2022 13:00:10 +0000 Subject: [PATCH] firmware: allow screendump in bootloader Enabled if target defines HAVE_BOOTLOADER_SCREENDUMP Change-Id: Idc135ef81e55d0f3eb8e7d2763d455c6455cf8fd --- firmware/SOURCES | 2 +- firmware/export/config.h | 4 ++++ firmware/export/screendump.h | 14 +++++++------- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/firmware/SOURCES b/firmware/SOURCES index 001a86335e..b72a7521e9 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES @@ -286,7 +286,7 @@ font_cache.c font.c hangul.c lru.c -#ifndef BOOTLOADER +#ifdef HAVE_SCREENDUMP screendump.c #endif #if LCD_DEPTH == 1 diff --git a/firmware/export/config.h b/firmware/export/config.h index efd99569b6..7002b2a3c5 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -1281,6 +1281,10 @@ Lyre prototype 1 */ #endif /* SIMULATOR */ #endif /* default SDL SW volume conditions */ +#if !defined(BOOTLOADER) || defined(HAVE_BOOTLOADER_SCREENDUMP) +# define HAVE_SCREENDUMP +#endif + /* null audiohw setting macro for when codec header is included for reasons other than audio support */ #define AUDIOHW_SETTING(name, us, nd, st, minv, maxv, defv, expr...) diff --git a/firmware/export/screendump.h b/firmware/export/screendump.h index 953184c3ac..b8fc27047d 100644 --- a/firmware/export/screendump.h +++ b/firmware/export/screendump.h @@ -52,12 +52,7 @@ #define DUMP_BMP_LINESIZE ((LCD_WIDTH*3 + 3) & ~3) #endif -#ifdef BOOTLOADER - -#define screen_dump() do { } while(0) -#define remote_screen_dump() do { } while(0) - -#else /* !BOOTLOADER */ +#ifdef HAVE_SCREENDUMP /* Save a .BMP file containing the current screen contents. */ void screen_dump(void); @@ -69,6 +64,11 @@ void screen_dump_set_hook(void (*hook)(int fd)); void remote_screen_dump(void); #endif -#endif /* !BOOTLOADER */ +#else /* !HAVE_SCREENDUMP */ + +#define screen_dump() do { } while(0) +#define remote_screen_dump() do { } while(0) + +#endif /* HAVE_SCREENDUMP */ #endif /* __SCREENDUMP_H__ */