diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2024-03-30 15:16:49 +0000 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2024-03-31 11:36:16 -0400 |
commit | 5fd5f56cacdd82ae10fb33496525e1614bcc0dd8 (patch) | |
tree | 8604d89e43c2094a0e01008dc2c4c51a38d4bc33 /firmware/export/scroll_engine.h | |
parent | b0a8cacd1dd11dbf6f8f7b46675d89e5b5b32920 (diff) | |
download | rockbox-5fd5f56cacdd82ae10fb33496525e1614bcc0dd8.tar.gz rockbox-5fd5f56cacdd82ae10fb33496525e1614bcc0dd8.zip |
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
Diffstat (limited to 'firmware/export/scroll_engine.h')
-rw-r--r-- | firmware/export/scroll_engine.h | 26 |
1 files changed, 26 insertions, 0 deletions
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); | |||
38 | extern void lcd_scroll_speed(int speed); | 38 | extern void lcd_scroll_speed(int speed); |
39 | extern void lcd_scroll_delay(int ms); | 39 | extern void lcd_scroll_delay(int ms); |
40 | 40 | ||
41 | #ifdef BOOTLOADER | ||
42 | static inline void lcd_scroll_stop(void) | ||
43 | { | ||
44 | } | ||
45 | |||
46 | static inline void lcd_scroll_stop_viewport(const struct viewport *vp) | ||
47 | { | ||
48 | (void)vp; | ||
49 | } | ||
50 | |||
51 | static inline void lcd_scroll_stop_viewport_rect(const struct viewport *vp, int x, int y, int width, int height) | ||
52 | { | ||
53 | (void)vp; | ||
54 | (void)x; | ||
55 | (void)y; | ||
56 | (void)width; | ||
57 | (void)height; | ||
58 | } | ||
59 | |||
60 | static inline bool lcd_scroll_now(struct scrollinfo *scroll) | ||
61 | { | ||
62 | (void)scroll; | ||
63 | return false; | ||
64 | } | ||
65 | #else | ||
41 | extern void lcd_scroll_stop(void); | 66 | extern void lcd_scroll_stop(void); |
42 | extern void lcd_scroll_stop_viewport(const struct viewport *vp); | 67 | extern void lcd_scroll_stop_viewport(const struct viewport *vp); |
43 | extern void lcd_scroll_stop_viewport_rect(const struct viewport *vp, int x, int y, int width, int height); | 68 | extern void lcd_scroll_stop_viewport_rect(const struct viewport *vp, int x, int y, int width, int height); |
44 | extern bool lcd_scroll_now(struct scrollinfo *scroll); | 69 | extern bool lcd_scroll_now(struct scrollinfo *scroll); |
70 | #endif | ||
45 | #ifdef HAVE_REMOTE_LCD | 71 | #ifdef HAVE_REMOTE_LCD |
46 | extern void lcd_remote_scroll_speed(int speed); | 72 | extern void lcd_remote_scroll_speed(int speed); |
47 | extern void lcd_remote_scroll_delay(int ms); | 73 | extern void lcd_remote_scroll_delay(int ms); |