mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-15 08:02:34 -05:00
iPod Video LCD driver: Reintroduce the simple method of waiting for update completion for use in the bootloader, because bootloaders don't enable interrupts and hence the tick task won't work. Slower than the full driver, but still faster than the old one, because it first transfers the data, and then polls the BCM.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15399 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
c888a9bebe
commit
9daf658ef1
1 changed files with 30 additions and 2 deletions
|
|
@ -107,6 +107,7 @@ static void bcm_setup_rect(unsigned x, unsigned y,
|
||||||
BCM_DATA32 = y + height - 1;
|
BCM_DATA32 = y + height - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef BOOTLOADER
|
||||||
static void lcd_tick(void)
|
static void lcd_tick(void)
|
||||||
{
|
{
|
||||||
/* No set_irq_level - already in interrupt context */
|
/* No set_irq_level - already in interrupt context */
|
||||||
|
|
@ -186,6 +187,29 @@ static void lcd_unblock_and_update(void)
|
||||||
set_irq_level(oldlevel);
|
set_irq_level(oldlevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else /* BOOTLOADER */
|
||||||
|
|
||||||
|
#define lcd_block_tick()
|
||||||
|
|
||||||
|
static void lcd_unblock_and_update(void)
|
||||||
|
{
|
||||||
|
unsigned data;
|
||||||
|
|
||||||
|
if (lcd_state.state != LCD_INITIAL)
|
||||||
|
{
|
||||||
|
data = bcm_read32(0x1F8);
|
||||||
|
while (data == 0xFFFA0005 || data == 0xFFFF)
|
||||||
|
{
|
||||||
|
yield();
|
||||||
|
data = bcm_read32(0x1F8);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bcm_write32(0x1F8, 0xFFFA0005); /* Kick off update */
|
||||||
|
BCM_CONTROL = 0x31;
|
||||||
|
lcd_state.state = LCD_IDLE;
|
||||||
|
}
|
||||||
|
#endif /* BOOTLOADER */
|
||||||
|
|
||||||
/*** hardware configuration ***/
|
/*** hardware configuration ***/
|
||||||
|
|
||||||
void lcd_set_contrast(int val)
|
void lcd_set_contrast(int val)
|
||||||
|
|
@ -210,11 +234,15 @@ void lcd_set_flip(bool yesno)
|
||||||
/* LCD init */
|
/* LCD init */
|
||||||
void lcd_init_device(void)
|
void lcd_init_device(void)
|
||||||
{
|
{
|
||||||
|
bcm_setup_rect(0, 0, LCD_WIDTH, LCD_HEIGHT);
|
||||||
lcd_state.blocked = false;
|
lcd_state.blocked = false;
|
||||||
lcd_state.state = LCD_INITIAL;
|
lcd_state.state = LCD_INITIAL;
|
||||||
|
#ifndef BOOTLOADER
|
||||||
|
#if NUM_CORES > 1
|
||||||
corelock_init(&lcd_state.cl);
|
corelock_init(&lcd_state.cl);
|
||||||
bcm_setup_rect(0, 0, LCD_WIDTH, LCD_HEIGHT);
|
#endif
|
||||||
tick_add_task(&lcd_tick);
|
tick_add_task(&lcd_tick);
|
||||||
|
#endif /* !BOOTLOADER */
|
||||||
}
|
}
|
||||||
|
|
||||||
/*** update functions ***/
|
/*** update functions ***/
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue