summaryrefslogtreecommitdiffstats
path: root/bootloader
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2008-09-16 16:51:25 +0000
committerFrank Gevaerts <frank@gevaerts.be>2008-09-16 16:51:25 +0000
commitc0e898ae2983d36f6f58f26b25f543c69d281457 (patch)
tree50e13b240ed62d092e6a737e1accda045f7bfa5c /bootloader
parent95bc9fd59682ea499adab4bf85cece255f3ba2db (diff)
downloadrockbox-c0e898ae2983d36f6f58f26b25f543c69d281457.tar.gz
rockbox-c0e898ae2983d36f6f58f26b25f543c69d281457.tar.bz2
rockbox-c0e898ae2983d36f6f58f26b25f543c69d281457.zip
Now reads the LCD controller ID succesfully and flashes it using the backlight
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18531 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'bootloader')
-rw-r--r--bootloader/meizu_m6sl.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/bootloader/meizu_m6sl.c b/bootloader/meizu_m6sl.c
index 442a0f9e18..86c4c5731e 100644
--- a/bootloader/meizu_m6sl.c
+++ b/bootloader/meizu_m6sl.c
@@ -77,9 +77,10 @@ void bl_debug(bool bit)
}
}
-void bl_debug_int(unsigned int input)
+void bl_debug_count(unsigned int input)
{
unsigned int i;
+ delay(SHORT_DELAY*3);
for (i = 0; i < input; i++)
{
PDAT0 ^= (1 << 2); //Toggle backlight
@@ -87,12 +88,26 @@ void bl_debug_int(unsigned int input)
PDAT0 ^= (1 << 2); //Toggle backlight
delay(2*SHORT_DELAY);
}
+}
+void bl_debug_int(unsigned int input,unsigned int count)
+{
+ unsigned int i;
+ for (i = 0; i < count; i++)
+ {
+ bl_debug(input>>i & 1);
+ }
delay(SHORT_DELAY*6);
}
+/* These functions are supposed to be static in lcd-m6sl.c, but
+ we use them here for testing */
+void init_lcd_spi(void);
+unsigned int lcd_read_id(void);
+
void main(void)
{
//Set backlight pin to output and enable
+ unsigned int model;
int oldval = PCON0;
PCON0 = ((oldval & ~(3 << 4)) | (1 << 4));
PDAT0 |= (1 << 2);
@@ -108,9 +123,18 @@ void main(void)
// Wait for play to be released
while((PDAT1 & (1 << 4)));
PDAT0 ^= (1 << 2); //Toggle backlight
+ delay(LONG_DELAY);
+
+ init_lcd_spi();
+ model=lcd_read_id();
+ bl_debug_count((model&0xf000)>>12);
+ bl_debug_count((model&0xf00)>>8);
+ bl_debug_count((model&0xf0)>>4);
+ bl_debug_count(model&0xf);
/* Calibrate the lot */
- qt1106_io(QT1106_MODE_FREE | QT1106_MOD_INF | QT1106_DI | QT1106_SLD_SLIDER | QT1106_CAL_WHEEL | QT1106_CAL_KEYS | QT1106_RES_4);
+ qt1106_io(QT1106_MODE_FREE | QT1106_MOD_INF | QT1106_DI \
+ | QT1106_SLD_SLIDER | QT1106_CAL_WHEEL | QT1106_CAL_KEYS | QT1106_RES_4);
/* Set to maximum sensitivity */
qt1106_io(QT1106_CT | (0x00 << 8) );
@@ -119,8 +143,10 @@ void main(void)
{
qt1106_wait();
- int slider = qt1106_io(QT1106_MODE_FREE | QT1106_MOD_INF | QT1106_DI | QT1106_SLD_SLIDER | QT1106_RES_4);
- bl_debug_int(((slider&0xff)) + 1);
+ int slider = qt1106_io(QT1106_MODE_FREE | QT1106_MOD_INF \
+ | QT1106_DI | QT1106_SLD_SLIDER | QT1106_RES_4);
+ if(slider & 0x008000)
+ bl_debug_count(((slider&0xff)) + 1);
}
//power off