summaryrefslogtreecommitdiffstats
path: root/firmware/target/mips/ingenic_jz47xx/onda_vx747
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2008-09-14 16:26:08 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2008-09-14 16:26:08 +0000
commit1e294e3f2518a5dd813a773b23271b12d22eeac4 (patch)
tree9c334b21456cbf5d806dbcfa7b9889bdb4fbaec1 /firmware/target/mips/ingenic_jz47xx/onda_vx747
parente3f1a3f33ef2e0a1a5aaf6368fc79b7e4cae0d2b (diff)
downloadrockbox-1e294e3f2518a5dd813a773b23271b12d22eeac4.tar.gz
rockbox-1e294e3f2518a5dd813a773b23271b12d22eeac4.zip
Onda VX747:
* Get rid of bug when interrupts are enabled * Get threading to work (although with some weirdness) * Other fixes/optimizations git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18512 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/lcd-onda_vx747.c44
-rw-r--r--firmware/target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c15
2 files changed, 31 insertions, 28 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx747/lcd-onda_vx747.c b/firmware/target/mips/ingenic_jz47xx/onda_vx747/lcd-onda_vx747.c
index 98fa8e7a20..3846987026 100644
--- a/firmware/target/mips/ingenic_jz47xx/onda_vx747/lcd-onda_vx747.c
+++ b/firmware/target/mips/ingenic_jz47xx/onda_vx747/lcd-onda_vx747.c
@@ -24,14 +24,14 @@
#include "r61509.h"
#include "lcd-target.h"
-#define PIN_CS_N (32*1+17) /* Chip select */
+#define PIN_CS_N (32*1+17) /* Chip select */
#define PIN_RESET_N (32*1+18) /* Reset */
-#define my__gpio_as_lcd_16bit() \
-do { \
- REG_GPIO_PXFUNS(2) = 0x001cffff; \
- REG_GPIO_PXSELC(2) = 0x001cffff; \
- REG_GPIO_PXPES(2) = 0x001cffff; \
+#define my__gpio_as_lcd_16bit() \
+do { \
+ REG_GPIO_PXFUNS(2) = 0x001cffff; \
+ REG_GPIO_PXSELC(2) = 0x001cffff; \
+ REG_GPIO_PXPES(2) = 0x001cffff; \
} while (0)
@@ -45,12 +45,12 @@ static void _display_pin_init(void)
__gpio_as_output(PIN_RESET_N);
__gpio_clear_pin(PIN_CS_N);
- __gpio_set_pin(PIN_RESET_N);
- DELAY;
- __gpio_clear_pin(PIN_RESET_N);
- DELAY;
- __gpio_set_pin(PIN_RESET_N);
- DELAY;
+ __gpio_set_pin(PIN_RESET_N);
+ DELAY;
+ __gpio_clear_pin(PIN_RESET_N);
+ DELAY;
+ __gpio_set_pin(PIN_RESET_N);
+ DELAY;
}
#define WAIT_ON_SLCD while(REG_SLCD_STATE & SLCD_STATE_BUSY);
@@ -189,7 +189,7 @@ static void _display_off(void)
static void _set_lcd_bus(void)
{
REG_LCD_CFG &= ~LCD_CFG_LCDPIN_MASK;
- REG_LCD_CFG |= LCD_CFG_LCDPIN_SLCD;
+ REG_LCD_CFG |= LCD_CFG_LCDPIN_SLCD;
REG_SLCD_CFG = (SLCD_CFG_BURST_8_WORD | SLCD_CFG_DWIDTH_16 | SLCD_CFG_CWIDTH_16BIT
| SLCD_CFG_CS_ACTIVE_LOW | SLCD_CFG_RS_CMD_LOW | SLCD_CFG_CLK_ACTIVE_FALLING
@@ -200,17 +200,17 @@ static void _set_lcd_bus(void)
static void _set_lcd_clock(void)
{
- unsigned int val;
- int pll_div;
+ unsigned int val;
+ int pll_div;
__cpm_stop_lcd();
- pll_div = ( REG_CPM_CPCCR & CPM_CPCCR_PCS ); /* clock source, 0:pllout/2 1: pllout */
- pll_div = pll_div ? 1 : 2 ;
- val = ( __cpm_get_pllout()/pll_div ) / 336000000;
- val--;
- if ( val > 0x1ff )
- val = 0x1ff; /* CPM_LPCDR is too large, set it to 0x1ff */
- __cpm_set_pixdiv(val);
+ pll_div = ( REG_CPM_CPCCR & CPM_CPCCR_PCS ); /* clock source, 0:pllout/2 1: pllout */
+ pll_div = pll_div ? 1 : 2 ;
+ val = ( __cpm_get_pllout()/pll_div ) / 336000000;
+ val--;
+ if ( val > 0x1ff )
+ val = 0x1ff; /* CPM_LPCDR is too large, set it to 0x1ff */
+ __cpm_set_pixdiv(val);
__cpm_start_lcd();
}
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 0f11782d3f..dd169c3a44 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
@@ -122,13 +122,16 @@ int button_read_device(int *data)
ret |= BUTTON_POWER;
}
- if(pendown_flag)
+ if(data != NULL)
{
- *data = touch_to_pixels(stable_x_pos, stable_y_pos);
- ret |= BUTTON_TOUCH;
+ if(pendown_flag)
+ {
+ *data = touch_to_pixels(stable_x_pos, stable_y_pos);
+ ret |= BUTTON_TOUCH;
+ }
+ else
+ *data = 0;
}
- else
- *data = 0;
return ret;
}
@@ -199,7 +202,7 @@ void SADC(void)
xData = (dat >> 0) & 0xfff;
yData = (dat >> 16) & 0xfff;
-
+
dat = REG_SADC_TSDAT;
tsz1Data = (dat >> 0) & 0xfff;
tsz2Data = (dat >> 16) & 0xfff;