summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2008-10-31 21:48:44 +0000
committerRafaël Carré <rafael.carre@gmail.com>2008-10-31 21:48:44 +0000
commitee593c95e22b0361431f97dcc8a91c0264a5485a (patch)
tree3b9ae563cc30aefe61a429bbf30079e6491fe1cc
parent19d1cacb1a63c306d842f81127d382512c49a062 (diff)
downloadrockbox-ee593c95e22b0361431f97dcc8a91c0264a5485a.tar.gz
rockbox-ee593c95e22b0361431f97dcc8a91c0264a5485a.zip
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
-rw-r--r--apps/plugin.c2
-rw-r--r--apps/plugin.h2
-rw-r--r--apps/plugins/mpegplayer/mpeg_settings.c6
-rw-r--r--apps/plugins/mpegplayer/mpegplayer.c6
-rw-r--r--docs/PLUGIN_API.new2
-rw-r--r--firmware/export/lcd.h4
6 files changed, 13 insertions, 9 deletions
diff --git a/apps/plugin.c b/apps/plugin.c
index 13c829805f..86e5c51128 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -133,7 +133,7 @@ static const struct plugin_api rockbox_api = {
133#ifdef HAVE_LCD_INVERT 133#ifdef HAVE_LCD_INVERT
134 lcd_set_invert_display, 134 lcd_set_invert_display,
135#endif /* HAVE_LCD_INVERT */ 135#endif /* HAVE_LCD_INVERT */
136#ifdef HAVE_LCD_ENABLE 136#if defined(HAVE_LCD_ENABLE) && defined(HAVE_LCD_COLOR)
137 lcd_set_enable_hook, 137 lcd_set_enable_hook,
138 &button_queue, 138 &button_queue,
139#endif 139#endif
diff --git a/apps/plugin.h b/apps/plugin.h
index 4f747ea2b1..08d0b603ac 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -226,7 +226,7 @@ struct plugin_api {
226 void (*lcd_set_invert_display)(bool yesno); 226 void (*lcd_set_invert_display)(bool yesno);
227#endif /* HAVE_LCD_INVERT */ 227#endif /* HAVE_LCD_INVERT */
228 228
229#ifdef HAVE_LCD_ENABLE 229#if defined(HAVE_LCD_ENABLE) && defined(HAVE_LCD_COLOR)
230 void (*lcd_set_enable_hook)(void (*enable_hook)(void)); 230 void (*lcd_set_enable_hook)(void (*enable_hook)(void));
231 struct event_queue *button_queue; 231 struct event_queue *button_queue;
232#endif 232#endif
diff --git a/apps/plugins/mpegplayer/mpeg_settings.c b/apps/plugins/mpegplayer/mpeg_settings.c
index 519fd0f059..14863c943d 100644
--- a/apps/plugins/mpegplayer/mpeg_settings.c
+++ b/apps/plugins/mpegplayer/mpeg_settings.c
@@ -571,7 +571,7 @@ static int get_start_time(uint32_t duration)
571 lcd_(clear_display)(); 571 lcd_(clear_display)();
572 lcd_(update)(); 572 lcd_(update)();
573 573
574#ifdef HAVE_LCD_ENABLE 574#if defined(HAVE_LCD_ENABLE) && defined(HAVE_LCD_COLOR)
575 rb->lcd_set_enable_hook(get_start_time_lcd_enable_hook); 575 rb->lcd_set_enable_hook(get_start_time_lcd_enable_hook);
576#endif 576#endif
577 577
@@ -762,11 +762,11 @@ static int get_start_time(uint32_t duration)
762 rb->yield(); 762 rb->yield();
763 } 763 }
764 764
765#ifdef HAVE_LCD_COLOR
765#ifdef HAVE_LCD_ENABLE 766#ifdef HAVE_LCD_ENABLE
766 rb->lcd_set_enable_hook(NULL); 767 rb->lcd_set_enable_hook(NULL);
767#endif 768#endif
768 769#else
769#ifndef HAVE_LCD_COLOR
770 stream_gray_show(false); 770 stream_gray_show(false);
771 grey_clear_display(); 771 grey_clear_display();
772 grey_update(); 772 grey_update();
diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c
index cb8c0d2133..5e34c2b041 100644
--- a/apps/plugins/mpegplayer/mpegplayer.c
+++ b/apps/plugins/mpegplayer/mpegplayer.c
@@ -612,11 +612,11 @@ static void wvs_backlight_on_video_mode(bool video_on)
612 /* Turn off backlight timeout */ 612 /* Turn off backlight timeout */
613 /* backlight control in lib/helper.c */ 613 /* backlight control in lib/helper.c */
614 backlight_force_on(rb); 614 backlight_force_on(rb);
615#ifdef HAVE_LCD_ENABLE 615#if defined(HAVE_LCD_ENABLE) && defined(HAVE_LCD_COLOR)
616 rb->lcd_set_enable_hook(NULL); 616 rb->lcd_set_enable_hook(NULL);
617#endif 617#endif
618 } else { 618 } else {
619#ifdef HAVE_LCD_ENABLE 619#if defined(HAVE_LCD_ENABLE) && defined(HAVE_LCD_COLOR)
620 rb->lcd_set_enable_hook(wvs_lcd_enable_hook); 620 rb->lcd_set_enable_hook(wvs_lcd_enable_hook);
621#endif 621#endif
622 /* Revert to user's backlight settings */ 622 /* Revert to user's backlight settings */
@@ -1605,7 +1605,7 @@ static void button_loop(void)
1605 1605
1606 wvs_stop(); 1606 wvs_stop();
1607 1607
1608#ifdef HAVE_LCD_ENABLE 1608#if defined(HAVE_LCD_ENABLE) && defined(HAVE_LCD_COLOR)
1609 /* Be sure hook is removed before exiting since the stop will put it 1609 /* Be sure hook is removed before exiting since the stop will put it
1610 * back because of the backlight restore. */ 1610 * back because of the backlight restore. */
1611 rb->lcd_set_enable_hook(NULL); 1611 rb->lcd_set_enable_hook(NULL);
diff --git a/docs/PLUGIN_API.new b/docs/PLUGIN_API.new
index 02e9c8c157..1f24ac08bc 100644
--- a/docs/PLUGIN_API.new
+++ b/docs/PLUGIN_API.new
@@ -1394,7 +1394,7 @@ void lcd_set_drawmode(int mode)
1394 \description 1394 \description
1395 1395
1396void lcd_set_enable_hook(void (*enable_hook)(void)) 1396void lcd_set_enable_hook(void (*enable_hook)(void))
1397 \conditions !defined(HAVE_LCD_CHARCELLS) )) && (defined(HAVE_LCD_ENABLE 1397 \conditions !defined(HAVE_LCD_CHARCELLS) && defined(HAVE_LCD_ENABLE) && defined(HAVE_LCD_COLOR)
1398 \param enable_hook 1398 \param enable_hook
1399 \description 1399 \description
1400 1400
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h
index 0aec5d0cbf..60329147da 100644
--- a/firmware/export/lcd.h
+++ b/firmware/export/lcd.h
@@ -338,9 +338,13 @@ void lcd_poweroff(void);
338/* Enable/disable the main display. */ 338/* Enable/disable the main display. */
339extern void lcd_enable(bool on); 339extern void lcd_enable(bool on);
340extern bool lcd_enabled(void); 340extern bool lcd_enabled(void);
341
342#ifdef HAVE_LCD_COLOR
341/* Register a hook that is called when the lcd is powered and after the 343/* Register a hook that is called when the lcd is powered and after the
342 * framebuffer data is synchronized */ 344 * framebuffer data is synchronized */
343void lcd_set_enable_hook(void (*enable_hook)(void)); 345void lcd_set_enable_hook(void (*enable_hook)(void));
346#endif /* HAVE_LCD_COLOR */
347
344#endif /* HAVE_LCD_ENABLE */ 348#endif /* HAVE_LCD_ENABLE */
345void lcd_call_enable_hook(void); 349void lcd_call_enable_hook(void);
346 350