summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/target/mips/ingenic_jz47xx/onda_vx767/button-ondavx767.c39
-rw-r--r--firmware/target/mips/ingenic_jz47xx/onda_vx767/button-target.h12
-rw-r--r--firmware/target/mips/ingenic_jz47xx/onda_vx767/lcd-ondavx767.c5
3 files changed, 41 insertions, 15 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx767/button-ondavx767.c b/firmware/target/mips/ingenic_jz47xx/onda_vx767/button-ondavx767.c
index 8b033a1bee..d98df9c42d 100644
--- a/firmware/target/mips/ingenic_jz47xx/onda_vx767/button-ondavx767.c
+++ b/firmware/target/mips/ingenic_jz47xx/onda_vx767/button-ondavx767.c
@@ -24,26 +24,35 @@
#include "jz4740.h"
#include "button-target.h"
-#define BTN_VOL_DOWN (1 << 27)
+#define BTN_VOL_DOWN ((1 << 27) | (1 << 21) | (1 << 30))
#define BTN_VOL_UP (1 << 0)
-#define BTN_MENU (1 << 1)
-#define BTN_OFF (1 << 29)
-#define BTN_HOLD (1 << 16)
-#define BTN_MASK (BTN_VOL_DOWN | BTN_VOL_UP \
- | BTN_MENU | BTN_OFF )
+#define BTN_MENU (1 << 3)
+#define BTN_BACK (1 << 4)
+#define BTN_SELECT (1 << 29)
+#define BTN_REWIND (1 << 1)
+#define BTN_FAST_FWD (1 << 2)
+#define BTN_HOLD (1 << 31) /* Unknown currently */
+#define BTN_MASK (BTN_VOL_DOWN | BTN_VOL_UP | BTN_MENU \
+ | BTN_BACK | BTN_SELECT | BTN_REWIND \
+ | BTN_FAST_FWD)
bool button_hold(void)
{
- return (~REG_GPIO_PXPIN(3) & BTN_HOLD ? 1 : 0);
+ return (~__gpio_get_port(3) & BTN_HOLD ? 1 : 0);
}
void button_init_device(void)
{
- __gpio_port_as_input(3, 29);
+ __gpio_port_as_input(3, 30);
+ __gpio_port_as_input(3, 21);
__gpio_port_as_input(3, 27);
- __gpio_port_as_input(3, 16);
- __gpio_port_as_input(3, 1);
__gpio_port_as_input(3, 0);
+ __gpio_port_as_input(3, 3);
+ __gpio_port_as_input(3, 4);
+ __gpio_port_as_input(3, 29);
+ __gpio_port_as_input(3, 1);
+ __gpio_port_as_input(3, 2);
+ /* __gpio_port_as_input(3, 31); */
}
int button_read_device(void)
@@ -60,10 +69,16 @@ int button_read_device(void)
ret |= BUTTON_VOL_DOWN;
if(key & BTN_VOL_UP)
ret |= BUTTON_VOL_UP;
+ if(key & BTN_SELECT)
+ ret |= BUTTON_SELECT;
if(key & BTN_MENU)
ret |= BUTTON_MENU;
- if(key & BTN_OFF)
- ret |= BUTTON_POWER;
+ if(key & BTN_BACK)
+ ret |= BUTTON_BACK;
+ if(key & BTN_REWIND)
+ ret |= BUTTON_REWIND;
+ if(key & BTN_FAST_FWD)
+ ret |= BUTTON_FAST_FWD;
}
return ret;
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 32325d1423..8c0393b9f6 100644
--- a/firmware/target/mips/ingenic_jz47xx/onda_vx767/button-target.h
+++ b/firmware/target/mips/ingenic_jz47xx/onda_vx767/button-target.h
@@ -31,10 +31,13 @@ void button_init_device(void);
int button_read_device(void);
/* Main unit's buttons */
-#define BUTTON_POWER 0x00000001
+#define BUTTON_SELECT 0x00000001
#define BUTTON_VOL_UP 0x00000002
#define BUTTON_VOL_DOWN 0x00000004
#define BUTTON_MENU 0x00000008
+#define BUTTON_BACK 0x00000010
+#define BUTTON_REWIND 0x00000020
+#define BUTTON_FAST_FWD 0x00000040
/* Compatibility hacks for flipping. Needs a somewhat better fix. */
#define BUTTON_LEFT 0
@@ -42,13 +45,16 @@ int button_read_device(void);
#define BUTTON_UP 0
#define BUTTON_DOWN 0
-#define BUTTON_MAIN (BUTTON_POWER | BUTTON_VOL_UP | BUTTON_VOL_DOWN | BUTTON_MENU)
+#define BUTTON_MAIN (BUTTON_SELECT | BUTTON_VOL_UP | BUTTON_VOL_DOWN | BUTTON_MENU \
+ BUTTON_MENU | BUTTON_BACK | BUTTON_REWIND | BUTTON_FAST_FWD)
/* No remote */
#define BUTTON_REMOTE 0
+#define BUTTON_POWER 0 /* HACK */
+
/* Software power-off */
-#define POWEROFF_BUTTON BUTTON_POWER
+#define POWEROFF_BUTTON BUTTON_SELECT /* TODO */
#define POWEROFF_COUNT 10
#endif /* BUTTON_TARGET_H */
diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx767/lcd-ondavx767.c b/firmware/target/mips/ingenic_jz47xx/onda_vx767/lcd-ondavx767.c
index 056c068f23..010964f334 100644
--- a/firmware/target/mips/ingenic_jz47xx/onda_vx767/lcd-ondavx767.c
+++ b/firmware/target/mips/ingenic_jz47xx/onda_vx767/lcd-ondavx767.c
@@ -192,6 +192,11 @@ void lcd_set_target(short x, short y, short width, short height)
SLCD_SEND_COMMAND(0x52, x);
SLCD_SEND_COMMAND(0x53, x+width-1);
/* TODO */
+
+ __gpio_clear_pin(PIN_UNK_N);
+ SLCD_SET_COMMAND(0x22);
+ WAIT_ON_SLCD;
+ __gpio_set_pin(PIN_UNK_N);
}
void lcd_on(void)