diff options
Diffstat (limited to 'firmware/target')
-rw-r--r-- | firmware/target/mips/ingenic_jz47xx/xduoo_x3/sadc-xduoo_x3.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/xduoo_x3/sadc-xduoo_x3.c b/firmware/target/mips/ingenic_jz47xx/xduoo_x3/sadc-xduoo_x3.c index d4a3548305..16d5aab782 100644 --- a/firmware/target/mips/ingenic_jz47xx/xduoo_x3/sadc-xduoo_x3.c +++ b/firmware/target/mips/ingenic_jz47xx/xduoo_x3/sadc-xduoo_x3.c | |||
@@ -62,9 +62,12 @@ void button_init_device(void) | |||
62 | 62 | ||
63 | __gpio_disable_pull(PIN_BTN_POWER); | 63 | __gpio_disable_pull(PIN_BTN_POWER); |
64 | __gpio_disable_pull(PIN_BTN_HOLD); | 64 | __gpio_disable_pull(PIN_BTN_HOLD); |
65 | 65 | ||
66 | #if 0 | ||
67 | /* We poll this, no need to set it up for an interrupt */ | ||
66 | __gpio_as_irq_fall_edge(PIN_KEY_INT); | 68 | __gpio_as_irq_fall_edge(PIN_KEY_INT); |
67 | system_enable_irq(GPIO_IRQ(PIN_KEY_INT)); | 69 | system_enable_irq(GPIO_IRQ(PIN_KEY_INT)); |
70 | #endif | ||
68 | 71 | ||
69 | __gpio_set_pin(PIN_CHARGE_CON); /* 0.7 A */ | 72 | __gpio_set_pin(PIN_CHARGE_CON); /* 0.7 A */ |
70 | __gpio_as_output(PIN_CHARGE_CON); | 73 | __gpio_as_output(PIN_CHARGE_CON); |
@@ -85,7 +88,7 @@ int button_read_device(void) | |||
85 | { | 88 | { |
86 | static bool hold_button = false; | 89 | static bool hold_button = false; |
87 | bool hold_button_old; | 90 | bool hold_button_old; |
88 | 91 | ||
89 | hold_button_old = hold_button; | 92 | hold_button_old = hold_button; |
90 | hold_button = (__gpio_get_pin(PIN_BTN_HOLD) ? true : false); | 93 | hold_button = (__gpio_get_pin(PIN_BTN_HOLD) ? true : false); |
91 | 94 | ||
@@ -127,7 +130,7 @@ int button_read_device(void) | |||
127 | else | 130 | else |
128 | if (key_val < 2600) | 131 | if (key_val < 2600) |
129 | btn |= BUTTON_HOME; | 132 | btn |= BUTTON_HOME; |
130 | 133 | ||
131 | return btn; | 134 | return btn; |
132 | } | 135 | } |
133 | 136 | ||
@@ -202,7 +205,7 @@ void SADC(void) | |||
202 | sadcstate = REG_SADC_ADSTATE; | 205 | sadcstate = REG_SADC_ADSTATE; |
203 | state = REG_SADC_ADSTATE & (~REG_SADC_ADCTRL); | 206 | state = REG_SADC_ADSTATE & (~REG_SADC_ADCTRL); |
204 | REG_SADC_ADSTATE &= sadcstate; | 207 | REG_SADC_ADSTATE &= sadcstate; |
205 | 208 | ||
206 | if(state & ADCTRL_ARDYM) | 209 | if(state & ADCTRL_ARDYM) |
207 | { | 210 | { |
208 | key_val = REG_SADC_ADADAT; | 211 | key_val = REG_SADC_ADADAT; |