summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
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)
558 558
559#ifdef HAVE_LCD_FLIP 559#ifdef HAVE_LCD_FLIP
560/* 560/*
561 * helper function to swap LEFT/RIGHT, UP/DOWN (if present), and F1/F3 (Recorder) 561 * helper function to swap LEFT/RIGHT, UP/DOWN (if present)
562 */ 562 */
563static int button_flip(int button) 563static int button_flip(int button)
564{ 564{
565 int newbutton = button; 565 int newbutton = button;
566 566
567#if (CONFIG_PLATFORM & PLATFORM_NATIVE) 567#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
568 newbutton &= 568 newbutton &= ~(
569 ~(BUTTON_LEFT | BUTTON_RIGHT 569#if defined(BUTTON_LEFT) && defined(BUTTON_RIGHT)
570 BUTTON_LEFT | BUTTON_RIGHT
571#else
572#warning "LEFT/RIGHT not defined!"
573 0
574#endif
570#if defined(BUTTON_UP) && defined(BUTTON_DOWN) 575#if defined(BUTTON_UP) && defined(BUTTON_DOWN)
571 | BUTTON_UP | BUTTON_DOWN 576 | BUTTON_UP | BUTTON_DOWN
572#endif 577#endif
@@ -583,10 +588,15 @@ static int button_flip(int button)
583#endif 588#endif
584 ); 589 );
585 590
591#if defined(BUTTON_LEFT) && defined(BUTTON_RIGHT)
586 if (button & BUTTON_LEFT) 592 if (button & BUTTON_LEFT)
587 newbutton |= BUTTON_RIGHT; 593 newbutton |= BUTTON_RIGHT;
588 if (button & BUTTON_RIGHT) 594 if (button & BUTTON_RIGHT)
589 newbutton |= BUTTON_LEFT; 595 newbutton |= BUTTON_LEFT;
596#else
597#warning "LEFT/RIGHT not defined!"
598#endif
599
590#if defined(BUTTON_UP) && defined(BUTTON_DOWN) 600#if defined(BUTTON_UP) && defined(BUTTON_DOWN)
591 if (button & BUTTON_UP) 601 if (button & BUTTON_UP)
592 newbutton |= BUTTON_DOWN; 602 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 @@
32#define BUTTON_VOL_UP 0x00000020 32#define BUTTON_VOL_UP 0x00000020
33#define BUTTON_VOL_DOWN 0x00000040 33#define BUTTON_VOL_DOWN 0x00000040
34 34
35#define BUTTON_LEFT 0 35#define BUTTON_LEFT BUTTON_PREV
36#define BUTTON_RIGHT 0 36#define BUTTON_RIGHT BUTTON_NEXT
37 37
38#define BUTTON_MAIN (BUTTON_POWER | BUTTON_HOME | BUTTON_PREV | BUTTON_NEXT | \ 38#define BUTTON_MAIN (BUTTON_POWER | BUTTON_HOME | BUTTON_PREV | BUTTON_NEXT | \
39 BUTTON_PLAY | BUTTON_VOL_UP | BUTTON_VOL_DOWN) 39 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 @@
28#define BUTTON_MENU 0x00000002 28#define BUTTON_MENU 0x00000002
29#define BUTTON_PLAY 0x00000004 29#define BUTTON_PLAY 0x00000004
30 30
31/* there are no LEFT/RIGHT buttons, but other parts of the code expect them */
32#define BUTTON_LEFT 0
33#define BUTTON_RIGHT 0
34
35#define BUTTON_MAIN (BUTTON_PREVNEXT|BUTTON_MENU|BUTTON_PLAY) 31#define BUTTON_MAIN (BUTTON_PREVNEXT|BUTTON_MENU|BUTTON_PLAY)
36 32
37#define POWEROFF_BUTTON BUTTON_PLAY 33#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 @@
32#define BUTTON_REWIND 0x00000020 32#define BUTTON_REWIND 0x00000020
33#define BUTTON_FAST_FWD 0x00000040 33#define BUTTON_FAST_FWD 0x00000040
34 34
35/* Compatibility hacks for flipping. Needs a somewhat better fix. */ 35#define BUTTON_LEFT BUTTON_REWIND
36#define BUTTON_LEFT 0 36#define BUTTON_RIGHT BUTTON_FAST_FWD
37#define BUTTON_RIGHT 0
38#define BUTTON_UP 0
39#define BUTTON_DOWN 0
40 37
41#define BUTTON_MAIN (BUTTON_SELECT | BUTTON_VOL_UP | BUTTON_VOL_DOWN | BUTTON_MENU \ 38#define BUTTON_MAIN (BUTTON_SELECT | BUTTON_VOL_UP | BUTTON_VOL_DOWN | BUTTON_MENU \
42 BUTTON_MENU | BUTTON_BACK | BUTTON_REWIND | BUTTON_FAST_FWD) 39 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 @@
33#define BUTTON_VOL_UP 0x00000040 33#define BUTTON_VOL_UP 0x00000040
34#define BUTTON_VOL_DOWN 0x00000080 34#define BUTTON_VOL_DOWN 0x00000080
35#define BUTTON_PWRALT 0x00000100 /* BUTTON_POWER combo with other buttons */ 35#define BUTTON_PWRALT 0x00000100 /* BUTTON_POWER combo with other buttons */
36#define BUTTON_LEFT 0
37#define BUTTON_RIGHT 0
38 36
39#define BUTTON_MAIN (BUTTON_POWER | BUTTON_HOME | BUTTON_OPTION | BUTTON_PREV | \ 37#define BUTTON_MAIN (BUTTON_POWER | BUTTON_HOME | BUTTON_OPTION | BUTTON_PREV | \
40 BUTTON_NEXT | BUTTON_PLAY | BUTTON_VOL_UP | BUTTON_VOL_DOWN) 38 BUTTON_NEXT | BUTTON_PLAY | BUTTON_VOL_UP | BUTTON_VOL_DOWN)
41 39
40#define BUTTON_LEFT BUTTON_PREV
41#define BUTTON_RIGHT BUTTON_NEXT
42
42/* Software power-off */ 43/* Software power-off */
43#define POWEROFF_BUTTON BUTTON_POWER 44#define POWEROFF_BUTTON BUTTON_POWER
44#define POWEROFF_COUNT 10 45#define POWEROFF_COUNT 10