diff options
Diffstat (limited to 'firmware/target/arm/as3525')
4 files changed, 28 insertions, 6 deletions
diff --git a/firmware/target/arm/as3525/sansa-c200v2/lcd-c200v2.c b/firmware/target/arm/as3525/sansa-c200v2/lcd-c200v2.c index 2fc3e1f6c5..88adcd9d96 100644 --- a/firmware/target/arm/as3525/sansa-c200v2/lcd-c200v2.c +++ b/firmware/target/arm/as3525/sansa-c200v2/lcd-c200v2.c | |||
@@ -322,7 +322,7 @@ void lcd_enable(bool on) | |||
322 | if(on) | 322 | if(on) |
323 | { | 323 | { |
324 | _display_on(); | 324 | _display_on(); |
325 | lcd_call_enable_hook(); | 325 | lcd_activation_call_hook(); |
326 | } | 326 | } |
327 | else | 327 | else |
328 | { | 328 | { |
@@ -332,7 +332,7 @@ void lcd_enable(bool on) | |||
332 | } | 332 | } |
333 | } | 333 | } |
334 | 334 | ||
335 | bool lcd_enabled(void) | 335 | bool lcd_active(void) |
336 | { | 336 | { |
337 | return display_on; | 337 | return display_on; |
338 | } | 338 | } |
diff --git a/firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c b/firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c index bfa02e796d..640f6694c9 100644 --- a/firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c +++ b/firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c | |||
@@ -159,22 +159,43 @@ void lcd_set_flip(bool yesno) | |||
159 | } | 159 | } |
160 | } | 160 | } |
161 | 161 | ||
162 | #ifdef HAVE_LCD_ENABLE | ||
163 | static void (*lcd_activation_hook)(void) = NULL; | ||
164 | |||
165 | void lcd_activation_set_hook(void (*func)(void)) | ||
166 | { | ||
167 | lcd_activation_hook = func; | ||
168 | } | ||
169 | |||
170 | void lcd_activation_call_hook(void) | ||
171 | { | ||
172 | void (*func)(void) = lcd_activation_hook; | ||
173 | |||
174 | if (func != NULL) | ||
175 | func(); | ||
176 | } | ||
177 | |||
178 | |||
162 | void lcd_enable(bool enable) | 179 | void lcd_enable(bool enable) |
163 | { | 180 | { |
164 | if(display_on == enable) | 181 | if(display_on == enable) |
165 | return; | 182 | return; |
166 | 183 | ||
167 | if( (display_on = enable) ) /* simple '=' is not a typo ! */ | 184 | if( (display_on = enable) ) /* simple '=' is not a typo ! */ |
185 | { | ||
168 | lcd_write_command(LCD_SET_DISPLAY_ON); | 186 | lcd_write_command(LCD_SET_DISPLAY_ON); |
187 | lcd_activation_call_hook(); | ||
188 | } | ||
169 | else | 189 | else |
170 | lcd_write_command(LCD_SET_DISPLAY_OFF); | 190 | lcd_write_command(LCD_SET_DISPLAY_OFF); |
171 | } | 191 | } |
172 | 192 | ||
173 | bool lcd_enabled(void) | 193 | bool lcd_active(void) |
174 | { | 194 | { |
175 | return display_on; | 195 | return display_on; |
176 | } | 196 | } |
177 | 197 | ||
198 | #endif | ||
178 | 199 | ||
179 | /* LCD init, largely based on what OF does */ | 200 | /* LCD init, largely based on what OF does */ |
180 | void lcd_init_device(void) | 201 | void lcd_init_device(void) |
diff --git a/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c b/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c index 57d5649570..8715622717 100644 --- a/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c +++ b/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c | |||
@@ -328,7 +328,7 @@ void lcd_enable(bool on) | |||
328 | if(on) | 328 | if(on) |
329 | { | 329 | { |
330 | _display_on(); | 330 | _display_on(); |
331 | lcd_call_enable_hook(); | 331 | lcd_activation_call_hook(); |
332 | } | 332 | } |
333 | else | 333 | else |
334 | { | 334 | { |
@@ -338,7 +338,7 @@ void lcd_enable(bool on) | |||
338 | } | 338 | } |
339 | } | 339 | } |
340 | 340 | ||
341 | bool lcd_enabled(void) | 341 | bool lcd_active(void) |
342 | { | 342 | { |
343 | return display_on; | 343 | return display_on; |
344 | } | 344 | } |
diff --git a/firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c b/firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c index 44451133ca..5196784a2f 100644 --- a/firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c +++ b/firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c | |||
@@ -206,6 +206,7 @@ void lcd_enable(bool on) | |||
206 | /* a bit of delay before returning to | 206 | /* a bit of delay before returning to |
207 | * avoid irritating flash on backlight on */ | 207 | * avoid irritating flash on backlight on */ |
208 | while(delay--); | 208 | while(delay--); |
209 | lcd_activation_call_hook(); | ||
209 | 210 | ||
210 | } | 211 | } |
211 | else | 212 | else |
@@ -217,7 +218,7 @@ void lcd_enable(bool on) | |||
217 | } | 218 | } |
218 | } | 219 | } |
219 | 220 | ||
220 | bool lcd_enabled(void) | 221 | bool lcd_active(void) |
221 | { | 222 | { |
222 | return display_on; | 223 | return display_on; |
223 | } | 224 | } |