summaryrefslogtreecommitdiffstats
path: root/firmware/target/mips/ingenic_jz47xx/onda_vx747
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2009-04-20 18:28:51 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2009-04-20 18:28:51 +0000
commitbe8a27ad818c0db4c6687edce159bbbe9df7ff5e (patch)
treea6baefd29b28329bf107786669a86311d5f40db6 /firmware/target/mips/ingenic_jz47xx/onda_vx747
parent0eb5dc649f34ca136d0160bf5d43961a2c3cea05 (diff)
downloadrockbox-be8a27ad818c0db4c6687edce159bbbe9df7ff5e.tar.gz
rockbox-be8a27ad818c0db4c6687edce159bbbe9df7ff5e.tar.bz2
rockbox-be8a27ad818c0db4c6687edce159bbbe9df7ff5e.zip
Onda VX747: fix touchscreen issues when switching from bootloader to 'normal' Rockbox
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20754 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx/onda_vx747')
-rw-r--r--firmware/target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c44
1 files changed, 26 insertions, 18 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c b/firmware/target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c
index d7ad3eb3e6..ebc2f214a9 100644
--- a/firmware/target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c
+++ b/firmware/target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c
@@ -123,22 +123,7 @@ unsigned int battery_adc_voltage(void)
}
void button_init_device(void)
-{
- __cpm_start_sadc();
- REG_SADC_ENA = 0;
- REG_SADC_STATE &= ~REG_SADC_STATE;
- REG_SADC_CTRL = 0x1F;
-
- REG_SADC_CFG = SADC_CFG_INIT;
-
- system_enable_irq(IRQ_SADC);
-
- REG_SADC_SAMETIME = 10;
- REG_SADC_WAITTIME = 100;
- REG_SADC_STATE &= ~REG_SADC_STATE;
- REG_SADC_CTRL = ~(SADC_CTRL_PENDM | SADC_CTRL_PENUM | SADC_CTRL_TSRDYM | SADC_CTRL_PBATRDYM);
- REG_SADC_ENA = SADC_ENA_TSEN;
-
+{
#ifdef ONDA_VX747
__gpio_as_input(32*3 + 29);
__gpio_as_input(32*3 + 27);
@@ -152,8 +137,6 @@ void button_init_device(void)
__gpio_as_input(32*3 + 19);
__gpio_as_input(32*2 + 22);
#endif
-
- mutex_init(&battery_mtx);
}
bool button_hold(void)
@@ -282,4 +265,29 @@ void SADC(void)
void adc_init(void)
{
+ __cpm_start_sadc();
+ REG_SADC_ENA = 0;
+ REG_SADC_STATE &= (~REG_SADC_STATE);
+ REG_SADC_CTRL = 0x1f;
+
+ REG_SADC_CFG = SADC_CFG_INIT;
+
+ system_enable_irq(IRQ_SADC);
+
+ REG_SADC_SAMETIME = 10;
+ REG_SADC_WAITTIME = 100;
+ REG_SADC_STATE &= ~REG_SADC_STATE;
+ REG_SADC_CTRL = ~(SADC_CTRL_PENDM | SADC_CTRL_PENUM | SADC_CTRL_TSRDYM | SADC_CTRL_PBATRDYM);
+ REG_SADC_ENA = SADC_ENA_TSEN;
+
+ mutex_init(&battery_mtx);
+}
+
+void adc_close(void)
+{
+ REG_SADC_ENA = 0;
+ __intc_mask_irq(IRQ_SADC);
+ sleep(20);
+ __cpm_stop_sadc();
}
+