From adf2e4c9a012fda200431c92cb2c1707dbe2f0a3 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Wed, 28 May 2008 10:17:16 +0000 Subject: 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 --- firmware/drivers/lcd-16bit.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'firmware/drivers') 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) -- cgit v1.2.3