diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2008-05-28 10:17:16 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2008-05-28 10:17:16 +0000 |
commit | adf2e4c9a012fda200431c92cb2c1707dbe2f0a3 (patch) | |
tree | 3a2755b05f9e2092d5bff458929b825c955c66f1 /firmware/drivers | |
parent | b57b779fbced4a3fc1ecd0799a7666c2f1645f17 (diff) |
Targets with HAVE_LCD_ENABLE: Provide a means to receive notifications when the lcd is enabled and the image is refreshed so overlayed drawing can also be refreshed. Chiefly mpegplayer needs this so it can redraw the YUV data after the backlight is turned on while paused or when using 'Set Start Time'.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17640 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-rw-r--r-- | firmware/drivers/lcd-16bit.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/firmware/drivers/lcd-16bit.c b/firmware/drivers/lcd-16bit.c index c91d222830..020d6bf63a 100644 --- a/firmware/drivers/lcd-16bit.c +++ b/firmware/drivers/lcd-16bit.c @@ -49,6 +49,10 @@ fb_data lcd_framebuffer[LCD_FBHEIGHT][LCD_FBWIDTH] static fb_data* lcd_backdrop = NULL; static long lcd_backdrop_offset IDATA_ATTR = 0; +#ifdef HAVE_LCD_ENABLE +static void (*lcd_enable_hook)(void) = NULL; +#endif + static struct viewport default_vp = { .x = 0, @@ -84,6 +88,23 @@ void lcd_init(void) scroll_init(); } +/*** Helpers - consolidate optional code ***/ +#ifdef HAVE_LCD_ENABLE +void lcd_set_enable_hook(void (*enable_hook)(void)) +{ + lcd_enable_hook = enable_hook; +} + +/* To be called by target driver after enabling display and refreshing it */ +void lcd_call_enable_hook(void) +{ + void (*enable_hook)(void) = lcd_enable_hook; + + if (enable_hook != NULL) + enable_hook(); +} +#endif + /*** Viewports ***/ void lcd_set_viewport(struct viewport* vp) |