mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 05:05:20 -05:00
Make the meizu m3 load from flash, so interrupts work. More work is needed to get the m6sl "working" again
(patch by Denes Balatoni, FS#9499) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18827 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
d8b2645a64
commit
49ec9ea190
6 changed files with 404 additions and 65 deletions
|
|
@ -69,7 +69,7 @@ void lcd_set_flip(bool yesno)
|
|||
static void lcd_sleep(uint32_t t)
|
||||
{
|
||||
volatile uint32_t i;
|
||||
for(i=0;i<t;++i) t=t;
|
||||
for(i=0;i<t;++i);
|
||||
}
|
||||
|
||||
static uint8_t lcd_readdata()
|
||||
|
|
@ -115,6 +115,7 @@ void lcd_off() {
|
|||
void lcd_init_device(void)
|
||||
{
|
||||
uint8_t data[5];
|
||||
int i;
|
||||
|
||||
/* init basic things */
|
||||
PWRCON &= ~0x800;
|
||||
|
|
@ -126,25 +127,26 @@ void lcd_init_device(void)
|
|||
LCD_INTCON = 0;
|
||||
LCD_RST_TIME = 0x7ff;
|
||||
|
||||
/* detect lcd type */
|
||||
LCD_WCMD = 0x1;
|
||||
lcd_sleep(166670);
|
||||
LCD_WCMD = 0x11;
|
||||
lcd_sleep(2000040);
|
||||
lcd_readdata();
|
||||
LCD_WCMD = 0x4;
|
||||
lcd_sleep(100);
|
||||
data[0]=lcd_readdata();
|
||||
data[1]=lcd_readdata();
|
||||
data[2]=lcd_readdata();
|
||||
data[3]=lcd_readdata();
|
||||
data[4]=lcd_readdata();
|
||||
|
||||
lcd_type=0;
|
||||
if (((data[1]==0x38) && ((data[2] & 0xf0) == 0x80)) ||
|
||||
((data[2]==0x38) && ((data[3] & 0xf0) == 0x80)))
|
||||
lcd_type=1;
|
||||
|
||||
/* detect lcd type, it's not detected the first time for some reason */
|
||||
for(i=0;i<3;++i) {
|
||||
LCD_WCMD = 0x1;
|
||||
lcd_sleep(166670);
|
||||
LCD_WCMD = 0x11;
|
||||
lcd_sleep(2000040);
|
||||
lcd_readdata();
|
||||
LCD_WCMD = 0x4;
|
||||
lcd_sleep(100);
|
||||
data[0]=lcd_readdata();
|
||||
data[1]=lcd_readdata();
|
||||
data[2]=lcd_readdata();
|
||||
data[3]=lcd_readdata();
|
||||
data[4]=lcd_readdata();
|
||||
|
||||
lcd_type=0;
|
||||
if (((data[1]==0x38) && ((data[2] & 0xf0) == 0x80)) ||
|
||||
((data[2]==0x38) && ((data[3] & 0xf0) == 0x80)))
|
||||
lcd_type=1;
|
||||
}
|
||||
/* init lcd */
|
||||
if (lcd_type == 1) {
|
||||
LCD_WCMD = 0x3a;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue