From 7a1bf015417250205c342d5d6e9f7cfa73265439 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Thu, 8 Oct 2020 18:27:03 -0400 Subject: Undo the hacks that allowed targets without LEFT/RIGHT (UP/DN) to build. Replaced them with warnings until they are fixed *PROPERLY* Change-Id: I4425200e60f8b5224262a54f105b974cec471d22 --- firmware/drivers/button.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'firmware/drivers/button.c') diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index 58a9ab0b94..939f94884d 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c @@ -558,15 +558,20 @@ void button_close(void) #ifdef HAVE_LCD_FLIP /* - * helper function to swap LEFT/RIGHT, UP/DOWN (if present), and F1/F3 (Recorder) + * helper function to swap LEFT/RIGHT, UP/DOWN (if present) */ static int button_flip(int button) { int newbutton = button; #if (CONFIG_PLATFORM & PLATFORM_NATIVE) - newbutton &= - ~(BUTTON_LEFT | BUTTON_RIGHT + newbutton &= ~( +#if defined(BUTTON_LEFT) && defined(BUTTON_RIGHT) + BUTTON_LEFT | BUTTON_RIGHT +#else +#warning "LEFT/RIGHT not defined!" + 0 +#endif #if defined(BUTTON_UP) && defined(BUTTON_DOWN) | BUTTON_UP | BUTTON_DOWN #endif @@ -583,10 +588,15 @@ static int button_flip(int button) #endif ); +#if defined(BUTTON_LEFT) && defined(BUTTON_RIGHT) if (button & BUTTON_LEFT) newbutton |= BUTTON_RIGHT; if (button & BUTTON_RIGHT) newbutton |= BUTTON_LEFT; +#else +#warning "LEFT/RIGHT not defined!" +#endif + #if defined(BUTTON_UP) && defined(BUTTON_DOWN) if (button & BUTTON_UP) newbutton |= BUTTON_DOWN; -- cgit v1.2.3