summaryrefslogtreecommitdiffstats
path: root/firmware/drivers/button.c
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-10-08 18:27:03 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-10-08 20:30:08 -0400
commit7a1bf015417250205c342d5d6e9f7cfa73265439 (patch)
tree640d702bb66d190fb60a6e6df6b54d8806ae4835 /firmware/drivers/button.c
parentdc81f96fd1bf3ddfe4c9e750ff14a0238f85d776 (diff)
downloadrockbox-7a1bf015417250205c342d5d6e9f7cfa73265439.tar.gz
rockbox-7a1bf015417250205c342d5d6e9f7cfa73265439.zip
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
Diffstat (limited to 'firmware/drivers/button.c')
-rw-r--r--firmware/drivers/button.c16
1 files changed, 13 insertions, 3 deletions
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;