Make lcd_set_enable_hook() conditional on HAVE_LCD_ENABLE and HAVE_LCD_COLOR
This prepares for the Clip which will define HAVE_LCD_ENABLE but won't need the hook since the internal LCD framebuffer is updated regardless if the display is on or off. firmware/drivers/lcd-16bit.c has not been modified since HAVE_LCD_COLOR is obviously defined here git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18951 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
19d1cacb1a
commit
ee593c95e2
6 changed files with 13 additions and 9 deletions
|
@ -133,7 +133,7 @@ static const struct plugin_api rockbox_api = {
|
|||
#ifdef HAVE_LCD_INVERT
|
||||
lcd_set_invert_display,
|
||||
#endif /* HAVE_LCD_INVERT */
|
||||
#ifdef HAVE_LCD_ENABLE
|
||||
#if defined(HAVE_LCD_ENABLE) && defined(HAVE_LCD_COLOR)
|
||||
lcd_set_enable_hook,
|
||||
&button_queue,
|
||||
#endif
|
||||
|
|
|
@ -226,7 +226,7 @@ struct plugin_api {
|
|||
void (*lcd_set_invert_display)(bool yesno);
|
||||
#endif /* HAVE_LCD_INVERT */
|
||||
|
||||
#ifdef HAVE_LCD_ENABLE
|
||||
#if defined(HAVE_LCD_ENABLE) && defined(HAVE_LCD_COLOR)
|
||||
void (*lcd_set_enable_hook)(void (*enable_hook)(void));
|
||||
struct event_queue *button_queue;
|
||||
#endif
|
||||
|
|
|
@ -571,7 +571,7 @@ static int get_start_time(uint32_t duration)
|
|||
lcd_(clear_display)();
|
||||
lcd_(update)();
|
||||
|
||||
#ifdef HAVE_LCD_ENABLE
|
||||
#if defined(HAVE_LCD_ENABLE) && defined(HAVE_LCD_COLOR)
|
||||
rb->lcd_set_enable_hook(get_start_time_lcd_enable_hook);
|
||||
#endif
|
||||
|
||||
|
@ -762,11 +762,11 @@ static int get_start_time(uint32_t duration)
|
|||
rb->yield();
|
||||
}
|
||||
|
||||
#ifdef HAVE_LCD_COLOR
|
||||
#ifdef HAVE_LCD_ENABLE
|
||||
rb->lcd_set_enable_hook(NULL);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_LCD_COLOR
|
||||
#else
|
||||
stream_gray_show(false);
|
||||
grey_clear_display();
|
||||
grey_update();
|
||||
|
|
|
@ -612,11 +612,11 @@ static void wvs_backlight_on_video_mode(bool video_on)
|
|||
/* Turn off backlight timeout */
|
||||
/* backlight control in lib/helper.c */
|
||||
backlight_force_on(rb);
|
||||
#ifdef HAVE_LCD_ENABLE
|
||||
#if defined(HAVE_LCD_ENABLE) && defined(HAVE_LCD_COLOR)
|
||||
rb->lcd_set_enable_hook(NULL);
|
||||
#endif
|
||||
} else {
|
||||
#ifdef HAVE_LCD_ENABLE
|
||||
#if defined(HAVE_LCD_ENABLE) && defined(HAVE_LCD_COLOR)
|
||||
rb->lcd_set_enable_hook(wvs_lcd_enable_hook);
|
||||
#endif
|
||||
/* Revert to user's backlight settings */
|
||||
|
@ -1605,7 +1605,7 @@ static void button_loop(void)
|
|||
|
||||
wvs_stop();
|
||||
|
||||
#ifdef HAVE_LCD_ENABLE
|
||||
#if defined(HAVE_LCD_ENABLE) && defined(HAVE_LCD_COLOR)
|
||||
/* Be sure hook is removed before exiting since the stop will put it
|
||||
* back because of the backlight restore. */
|
||||
rb->lcd_set_enable_hook(NULL);
|
||||
|
|
|
@ -1394,7 +1394,7 @@ void lcd_set_drawmode(int mode)
|
|||
\description
|
||||
|
||||
void lcd_set_enable_hook(void (*enable_hook)(void))
|
||||
\conditions !defined(HAVE_LCD_CHARCELLS) )) && (defined(HAVE_LCD_ENABLE
|
||||
\conditions !defined(HAVE_LCD_CHARCELLS) && defined(HAVE_LCD_ENABLE) && defined(HAVE_LCD_COLOR)
|
||||
\param enable_hook
|
||||
\description
|
||||
|
||||
|
|
|
@ -338,9 +338,13 @@ void lcd_poweroff(void);
|
|||
/* Enable/disable the main display. */
|
||||
extern void lcd_enable(bool on);
|
||||
extern bool lcd_enabled(void);
|
||||
|
||||
#ifdef HAVE_LCD_COLOR
|
||||
/* Register a hook that is called when the lcd is powered and after the
|
||||
* framebuffer data is synchronized */
|
||||
void lcd_set_enable_hook(void (*enable_hook)(void));
|
||||
#endif /* HAVE_LCD_COLOR */
|
||||
|
||||
#endif /* HAVE_LCD_ENABLE */
|
||||
void lcd_call_enable_hook(void);
|
||||
|
||||
|
|
Loading…
Reference in a new issue