summaryrefslogtreecommitdiffstats
path: root/firmware
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
parentdc81f96fd1bf3ddfe4c9e750ff14a0238f85d776 (diff)
downloadrockbox-7a1bf015417250205c342d5d6e9f7cfa73265439.tar.gz
rockbox-7a1bf015417250205c342d5d6e9f7cfa73265439.tar.bz2
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')
-rw-r--r--firmware/drivers/button.c16
-rw-r--r--firmware/target/arm/rk27xx/ihifi2/button-target.h4
-rw-r--r--firmware/target/arm/s5l8700/meizu-m3/button-target.h4
-rw-r--r--firmware/target/mips/ingenic_jz47xx/onda_vx767/button-target.h7
-rw-r--r--firmware/target/mips/ingenic_jz47xx/xduoo_x3/button-target.h5
5 files changed, 20 insertions, 16 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;
diff --git a/firmware/target/arm/rk27xx/ihifi2/button-target.h b/firmware/target/arm/rk27xx/ihifi2/button-target.h
index 211e20e1d6..d317e30972 100644
--- a/firmware/target/arm/rk27xx/ihifi2/button-target.h
+++ b/firmware/target/arm/rk27xx/ihifi2/button-target.h
@@ -32,8 +32,8 @@
#define BUTTON_VOL_UP 0x00000020
#define BUTTON_VOL_DOWN 0x00000040
-#define BUTTON_LEFT 0
-#define BUTTON_RIGHT 0
+#define BUTTON_LEFT BUTTON_PREV
+#define BUTTON_RIGHT BUTTON_NEXT
#define BUTTON_MAIN (BUTTON_POWER | BUTTON_HOME | BUTTON_PREV | BUTTON_NEXT | \
BUTTON_PLAY | BUTTON_VOL_UP | BUTTON_VOL_DOWN)
diff --git a/firmware/target/arm/s5l8700/meizu-m3/button-target.h b/firmware/target/arm/s5l8700/meizu-m3/button-target.h
index 93f102c410..c438628cc9 100644
--- a/firmware/target/arm/s5l8700/meizu-m3/button-target.h
+++ b/firmware/target/arm/s5l8700/meizu-m3/button-target.h
@@ -28,10 +28,6 @@
#define BUTTON_MENU 0x00000002
#define BUTTON_PLAY 0x00000004
-/* there are no LEFT/RIGHT buttons, but other parts of the code expect them */
-#define BUTTON_LEFT 0
-#define BUTTON_RIGHT 0
-
#define BUTTON_MAIN (BUTTON_PREVNEXT|BUTTON_MENU|BUTTON_PLAY)
#define POWEROFF_BUTTON BUTTON_PLAY
diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx767/button-target.h b/firmware/target/mips/ingenic_jz47xx/onda_vx767/button-target.h
index 04b46f85c7..cea469c541 100644
--- a/firmware/target/mips/ingenic_jz47xx/onda_vx767/button-target.h
+++ b/firmware/target/mips/ingenic_jz47xx/onda_vx767/button-target.h
@@ -32,11 +32,8 @@
#define BUTTON_REWIND 0x00000020
#define BUTTON_FAST_FWD 0x00000040
-/* Compatibility hacks for flipping. Needs a somewhat better fix. */
-#define BUTTON_LEFT 0
-#define BUTTON_RIGHT 0
-#define BUTTON_UP 0
-#define BUTTON_DOWN 0
+#define BUTTON_LEFT BUTTON_REWIND
+#define BUTTON_RIGHT BUTTON_FAST_FWD
#define BUTTON_MAIN (BUTTON_SELECT | BUTTON_VOL_UP | BUTTON_VOL_DOWN | BUTTON_MENU \
BUTTON_MENU | BUTTON_BACK | BUTTON_REWIND | BUTTON_FAST_FWD)
diff --git a/firmware/target/mips/ingenic_jz47xx/xduoo_x3/button-target.h b/firmware/target/mips/ingenic_jz47xx/xduoo_x3/button-target.h
index 9e2800d57b..a471c419e6 100644
--- a/firmware/target/mips/ingenic_jz47xx/xduoo_x3/button-target.h
+++ b/firmware/target/mips/ingenic_jz47xx/xduoo_x3/button-target.h
@@ -33,12 +33,13 @@
#define BUTTON_VOL_UP 0x00000040
#define BUTTON_VOL_DOWN 0x00000080
#define BUTTON_PWRALT 0x00000100 /* BUTTON_POWER combo with other buttons */
-#define BUTTON_LEFT 0
-#define BUTTON_RIGHT 0
#define BUTTON_MAIN (BUTTON_POWER | BUTTON_HOME | BUTTON_OPTION | BUTTON_PREV | \
BUTTON_NEXT | BUTTON_PLAY | BUTTON_VOL_UP | BUTTON_VOL_DOWN)
+#define BUTTON_LEFT BUTTON_PREV
+#define BUTTON_RIGHT BUTTON_NEXT
+
/* Software power-off */
#define POWEROFF_BUTTON BUTTON_POWER
#define POWEROFF_COUNT 10