mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 21:25:19 -05:00
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
This commit is contained in:
parent
0eb5dc649f
commit
be8a27ad81
3 changed files with 31 additions and 18 deletions
|
|
@ -31,6 +31,7 @@
|
||||||
#include "storage.h"
|
#include "storage.h"
|
||||||
#include "disk.h"
|
#include "disk.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
|
#include "adc.h"
|
||||||
|
|
||||||
static void show_splash(int timeout, const char *msg)
|
static void show_splash(int timeout, const char *msg)
|
||||||
{
|
{
|
||||||
|
|
@ -101,6 +102,7 @@ int main(void)
|
||||||
font_init();
|
font_init();
|
||||||
lcd_setfont(FONT_SYSFIXED);
|
lcd_setfont(FONT_SYSFIXED);
|
||||||
button_init();
|
button_init();
|
||||||
|
adc_init();
|
||||||
storage_init();
|
storage_init();
|
||||||
|
|
||||||
reset_screen();
|
reset_screen();
|
||||||
|
|
@ -142,6 +144,7 @@ int main(void)
|
||||||
if (rc == EOK)
|
if (rc == EOK)
|
||||||
{
|
{
|
||||||
printf("Starting Rockbox...");
|
printf("Starting Rockbox...");
|
||||||
|
adc_close(); /* Disable SADC */
|
||||||
disable_interrupt();
|
disable_interrupt();
|
||||||
kernel_entry = (void*) CONFIG_SDRAM_START;
|
kernel_entry = (void*) CONFIG_SDRAM_START;
|
||||||
kernel_entry();
|
kernel_entry();
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,8 @@
|
||||||
|
|
||||||
#define CONFIG_I2C I2C_JZ47XX
|
#define CONFIG_I2C I2C_JZ47XX
|
||||||
|
|
||||||
|
#define NEED_ADC_CLOSE 1
|
||||||
|
|
||||||
/* has no tone controls, so we use the software ones */
|
/* has no tone controls, so we use the software ones */
|
||||||
//#define HAVE_SW_TONE_CONTROLS
|
//#define HAVE_SW_TONE_CONTROLS
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -123,22 +123,7 @@ unsigned int battery_adc_voltage(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
void button_init_device(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
|
#ifdef ONDA_VX747
|
||||||
__gpio_as_input(32*3 + 29);
|
__gpio_as_input(32*3 + 29);
|
||||||
__gpio_as_input(32*3 + 27);
|
__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*3 + 19);
|
||||||
__gpio_as_input(32*2 + 22);
|
__gpio_as_input(32*2 + 22);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mutex_init(&battery_mtx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool button_hold(void)
|
bool button_hold(void)
|
||||||
|
|
@ -282,4 +265,29 @@ void SADC(void)
|
||||||
|
|
||||||
void adc_init(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();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue