From 72c0e49b41b0da4a43a4852771eed3767fc675ad Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Wed, 17 May 2023 11:50:38 -0400 Subject: scroll: Fix red from previous commit. Targets with remote LCDs need to have the lcd scroll driver instantiated, even in the bootloader. This is because lcd_remote_scroll_stop() is called, in addition to lcd_scroll_stop(). This could probably be excised. Change-Id: I475269f9361eb469c62ad0f74abc1eb3baa4c134 --- firmware/drivers/lcd-scroll.c | 2 +- firmware/scroll_engine.c | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/firmware/drivers/lcd-scroll.c b/firmware/drivers/lcd-scroll.c index dfdf78ecda..cd8fc4587e 100644 --- a/firmware/drivers/lcd-scroll.c +++ b/firmware/drivers/lcd-scroll.c @@ -180,7 +180,7 @@ bool LCDFN(scroll_now)(struct scrollinfo *s) return ended; } -#if !defined(BOOTLOADER) || defined(HAVE_REMOTE_LCD) +#if !defined(BOOTLOADER) static void LCDFN(scroll_worker)(void) { int index; diff --git a/firmware/scroll_engine.c b/firmware/scroll_engine.c index 11355d1872..c32f4632e2 100644 --- a/firmware/scroll_engine.c +++ b/firmware/scroll_engine.c @@ -45,13 +45,7 @@ static const char scroll_tick_table[18] = { #include "drivers/lcd-scroll.c" -#ifndef BOOTLOADER -static void scroll_thread(void); -static const char scroll_name[] = "scroll"; - #ifdef HAVE_REMOTE_LCD -static struct event_queue scroll_queue SHAREDBSS_ATTR; - /* copied from lcd-remote-1bit.c */ /* Compile 1 bit vertical packing LCD driver for remote LCD */ #undef LCDFN @@ -59,7 +53,11 @@ static struct event_queue scroll_queue SHAREDBSS_ATTR; #undef LCDM #define LCDM(ma) LCD_REMOTE_ ## ma -#include "drivers/lcd-scroll.c" // Yes, a second time. +#include "drivers/lcd-scroll.c" +#endif /* HAVE_REMOTE_LCD */ + +#if defined(HAVE_REMOTE_LCD) && !defined(BOOTLOADER) +static struct event_queue scroll_queue SHAREDBSS_ATTR; static void sync_display_ticks(void) { @@ -102,9 +100,13 @@ static bool scroll_process_message(int delay) return false; } -#endif /* HAVE_REMOTE_LCD */ +#endif /* HAVE_REMOTE_LCD && !BOOTLOADER */ +#if !defined(BOOTLOADER) +static void scroll_thread(void); +static const char scroll_name[] = "scroll"; static void scroll_thread(void) NORETURN_ATTR; + #ifdef HAVE_REMOTE_LCD static void scroll_thread(void) { @@ -170,7 +172,7 @@ static void scroll_thread(void) } } } -#else +#else /* !HAVE_REMOTE_LCD */ static void scroll_thread(void) { while (1) @@ -182,7 +184,7 @@ static void scroll_thread(void) lcd_scroll_worker(); } } -#endif /* HAVE_REMOTE_LCD */ +#endif /* !HAVE_REMOTE_LCD */ void scroll_init(void) { @@ -195,9 +197,9 @@ void scroll_init(void) IF_PRIO(, PRIORITY_USER_INTERFACE) IF_COP(, CPU)); } -#else +#else /* BOOTLOADER */ void scroll_init(void) { /* DUMMY */ } -#endif /* ndef BOOTLOADER*/ +#endif /* BOOTLOADER*/ -- cgit v1.2.3