From 5fd5f56cacdd82ae10fb33496525e1614bcc0dd8 Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Sat, 30 Mar 2024 15:16:49 +0000 Subject: Disable unused LCD scroll functions in bootloaders These functions just reset some state related to the scroll engine, which is already disabled for bootloaders. They get called from the LCD code and compiled into the binary, but have no real effect when the rest of the scroll engine is not present. Replacing the calls with inline stubs gets rid of this dead code from bootloaders. Change-Id: I12a6d8926e19477ae3a5913e7fc8aff41cecd970 --- firmware/export/scroll_engine.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'firmware/export') diff --git a/firmware/export/scroll_engine.h b/firmware/export/scroll_engine.h index f13e2efca7..2a1a510dbd 100644 --- a/firmware/export/scroll_engine.h +++ b/firmware/export/scroll_engine.h @@ -38,10 +38,36 @@ extern void lcd_bidir_scroll(int threshold); extern void lcd_scroll_speed(int speed); extern void lcd_scroll_delay(int ms); +#ifdef BOOTLOADER +static inline void lcd_scroll_stop(void) +{ +} + +static inline void lcd_scroll_stop_viewport(const struct viewport *vp) +{ + (void)vp; +} + +static inline void lcd_scroll_stop_viewport_rect(const struct viewport *vp, int x, int y, int width, int height) +{ + (void)vp; + (void)x; + (void)y; + (void)width; + (void)height; +} + +static inline bool lcd_scroll_now(struct scrollinfo *scroll) +{ + (void)scroll; + return false; +} +#else extern void lcd_scroll_stop(void); extern void lcd_scroll_stop_viewport(const struct viewport *vp); extern void lcd_scroll_stop_viewport_rect(const struct viewport *vp, int x, int y, int width, int height); extern bool lcd_scroll_now(struct scrollinfo *scroll); +#endif #ifdef HAVE_REMOTE_LCD extern void lcd_remote_scroll_speed(int speed); extern void lcd_remote_scroll_delay(int ms); -- cgit v1.2.3