Make the LCD remote work in the Iriver H1x0 and H300 bootloaders as well (untested). * Only try the initial remote LCD init if the remote is plugged, and do it in main builds as well, giving slightly earlier remote LCD output when booting. * Fix delays in the X5/M5 remote LCD init. * Remove an unnecessary check in the X5/M5 remote LCD driver and the M3 LCD driver.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16655 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2008-03-13 19:36:58 +00:00
parent bf3c96c502
commit 3c561f2cf9
3 changed files with 42 additions and 36 deletions

View file

@ -324,7 +324,7 @@ void lcd_remote_on(void)
{
CS_HI;
CLK_HI;
sleep(10);
sleep(HZ/100);
lcd_remote_write_command(LCD_SET_DUTY_RATIO);
lcd_remote_write_command(0x70); /* 1/128 */
@ -339,7 +339,7 @@ void lcd_remote_on(void)
lcd_remote_write_command(LCD_CONTROL_POWER | 7); /* All circuits ON */
sleep(30);
sleep(3*HZ/100);
lcd_remote_write_command_ex(LCD_SET_GRAY | 0, 0x00);
lcd_remote_write_command_ex(LCD_SET_GRAY | 1, 0x00);
@ -371,7 +371,7 @@ void lcd_remote_off(void)
void lcd_remote_poweroff(void)
{
/* Set power save -> Power OFF (VDD - VSS) .. that's it */
if (remote_initialized && remote_detect())
if (remote_initialized)
lcd_remote_write_command(LCD_SET_POWER_SAVE | 1);
}
@ -430,9 +430,9 @@ void lcd_remote_init_device(void)
or_l(0x01000000, &GPIO_FUNCTION);
lcd_remote_clear_display();
#ifdef BOOTLOADER
if (remote_detect())
lcd_remote_on();
#else
#ifndef BOOTLOADER
tick_add_task(remote_tick);
#endif
}

View file

@ -362,7 +362,7 @@ void lcd_off(void)
void lcd_poweroff(void)
{
/* Set power save -> Power OFF (VDD - VSS) .. that's it */
if (initialized && remote_detect())
if (initialized)
lcd_write_command(LCD_SET_POWER_SAVE | 1);
}
@ -421,9 +421,9 @@ void lcd_init_device(void)
or_l(0x40000000, &GPIO_FUNCTION);
lcd_clear_display();
#ifdef BOOTLOADER
if (remote_detect())
lcd_on();
#else
#ifndef BOOTLOADER
tick_add_task(lcd_tick);
#endif
}

View file

@ -72,7 +72,6 @@ static bool cached_invert = false;
static bool cached_flip = false;
static int cached_contrast = DEFAULT_REMOTE_CONTRAST_SETTING;
static void remote_tick(void);
#ifdef HAVE_REMOTE_LCD_TICKING
static inline void _byte_delay(int delay)
@ -414,31 +413,6 @@ int remote_type(void)
return _remote_type;
}
void lcd_remote_init_device(void)
{
#ifdef IRIVER_H300_SERIES
or_l(0x10010000, &GPIO_FUNCTION); /* GPIO16: RS
GPIO28: CLK */
or_l(0x00040006, &GPIO1_FUNCTION); /* GPO33: Backlight
GPIO34: CS
GPIO50: Data */
or_l(0x10010000, &GPIO_ENABLE);
or_l(0x00040006, &GPIO1_ENABLE);
#else
or_l(0x10010800, &GPIO_FUNCTION); /* GPIO11: Backlight
GPIO16: RS
GPIO28: CLK */
or_l(0x00040004, &GPIO1_FUNCTION); /* GPIO34: CS
GPIO50: Data */
or_l(0x10010800, &GPIO_ENABLE);
or_l(0x00040004, &GPIO1_ENABLE);
#endif
lcd_remote_clear_display();
tick_add_task(remote_tick);
}
void lcd_remote_on(void)
{
CS_HI;
@ -475,6 +449,7 @@ void lcd_remote_off(void)
CS_HI;
}
#ifndef BOOTLOADER
/* Monitor remote hotswap */
static void remote_tick(void)
{
@ -549,6 +524,37 @@ static void remote_tick(void)
if (cs_countdown == 0)
CS_HI;
}
#endif
void lcd_remote_init_device(void)
{
#ifdef IRIVER_H300_SERIES
or_l(0x10010000, &GPIO_FUNCTION); /* GPIO16: RS
GPIO28: CLK */
or_l(0x00040006, &GPIO1_FUNCTION); /* GPO33: Backlight
GPIO34: CS
GPIO50: Data */
or_l(0x10010000, &GPIO_ENABLE);
or_l(0x00040006, &GPIO1_ENABLE);
#else
or_l(0x10010800, &GPIO_FUNCTION); /* GPIO11: Backlight
GPIO16: RS
GPIO28: CLK */
or_l(0x00040004, &GPIO1_FUNCTION); /* GPIO34: CS
GPIO50: Data */
or_l(0x10010800, &GPIO_ENABLE);
or_l(0x00040004, &GPIO1_ENABLE);
#endif
lcd_remote_clear_display();
if (remote_detect())
lcd_remote_on();
#ifndef BOOTLOADER
tick_add_task(remote_tick);
#endif
}
/* Update the display.
This must be called after all other LCD functions that change the display. */