diff options
author | Thomas Martitz <kugel@rockbox.org> | 2009-03-17 02:43:47 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2009-03-17 02:43:47 +0000 |
commit | b7739fbf1c838cb6e6e47f9d28d5b339828e1e30 (patch) | |
tree | f4011d6a14cd93fae2002eeccdd63e039ab44f7e /firmware/drivers/lcd-16bit.c | |
parent | aad712d39f3cdeb95a22e56edb805554dd0a90e1 (diff) | |
download | rockbox-b7739fbf1c838cb6e6e47f9d28d5b339828e1e30.tar.gz rockbox-b7739fbf1c838cb6e6e47f9d28d5b339828e1e30.zip |
Rework lcd_enabled and lcd_set/call_enable hook
a) lcd_enabled() is now lcd_active(), and is available for HAVE_LCD_SLEEP only targets (e.g. ipod video) too. It was depandent on HAVE_LCD_ENALE only before
b) rename the hook accordingly, and implement the hook for other other targets too (e.g. the clip [the only mono target with lcd_enable/lcd_sleep yet, so the code is still in the lcd driver], ipod, fuze, c200)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20331 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/lcd-16bit.c')
-rw-r--r-- | firmware/drivers/lcd-16bit.c | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/firmware/drivers/lcd-16bit.c b/firmware/drivers/lcd-16bit.c index c3e076b392..0aa62f66b4 100644 --- a/firmware/drivers/lcd-16bit.c +++ b/firmware/drivers/lcd-16bit.c | |||
@@ -51,10 +51,6 @@ fb_data lcd_framebuffer[LCD_FBHEIGHT][LCD_FBWIDTH] | |||
51 | static fb_data* lcd_backdrop = NULL; | 51 | static fb_data* lcd_backdrop = NULL; |
52 | static long lcd_backdrop_offset IDATA_ATTR = 0; | 52 | static long lcd_backdrop_offset IDATA_ATTR = 0; |
53 | 53 | ||
54 | #ifdef HAVE_LCD_ENABLE | ||
55 | static void (*lcd_enable_hook)(void) = NULL; | ||
56 | #endif | ||
57 | |||
58 | static struct viewport default_vp = | 54 | static struct viewport default_vp = |
59 | { | 55 | { |
60 | .x = 0, | 56 | .x = 0, |
@@ -78,33 +74,36 @@ static struct viewport* current_vp IDATA_ATTR = &default_vp; | |||
78 | struct viewport* current_vp IDATA_ATTR = &default_vp; | 74 | struct viewport* current_vp IDATA_ATTR = &default_vp; |
79 | #endif | 75 | #endif |
80 | 76 | ||
81 | /* LCD init */ | ||
82 | void lcd_init(void) | ||
83 | { | ||
84 | lcd_clear_display(); | ||
85 | |||
86 | /* Call device specific init */ | ||
87 | lcd_init_device(); | ||
88 | scroll_init(); | ||
89 | } | ||
90 | 77 | ||
91 | /*** Helpers - consolidate optional code ***/ | 78 | /*** Helpers - consolidate optional code ***/ |
92 | #ifdef HAVE_LCD_ENABLE | 79 | #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) |
93 | void lcd_set_enable_hook(void (*enable_hook)(void)) | 80 | static void (*lcd_activation_hook)(void) = NULL; |
81 | |||
82 | void lcd_activation_set_hook(void (*func)(void)) | ||
94 | { | 83 | { |
95 | lcd_enable_hook = enable_hook; | 84 | lcd_activation_hook = func; |
96 | } | 85 | } |
97 | 86 | ||
98 | /* To be called by target driver after enabling display and refreshing it */ | 87 | /* To be called by target driver after enabling display and refreshing it */ |
99 | void lcd_call_enable_hook(void) | 88 | void lcd_activation_call_hook(void) |
100 | { | 89 | { |
101 | void (*enable_hook)(void) = lcd_enable_hook; | 90 | void (*func)(void) = lcd_activation_hook; |
102 | 91 | ||
103 | if (enable_hook != NULL) | 92 | if (func != NULL) |
104 | enable_hook(); | 93 | func(); |
105 | } | 94 | } |
95 | |||
106 | #endif | 96 | #endif |
107 | 97 | ||
98 | /* LCD init */ | ||
99 | void lcd_init(void) | ||
100 | { | ||
101 | lcd_clear_display(); | ||
102 | |||
103 | /* Call device specific init */ | ||
104 | lcd_init_device(); | ||
105 | scroll_init(); | ||
106 | } | ||
108 | /*** Viewports ***/ | 107 | /*** Viewports ***/ |
109 | 108 | ||
110 | void lcd_set_viewport(struct viewport* vp) | 109 | void lcd_set_viewport(struct viewport* vp) |