summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-10-20 21:54:59 +0000
committerThomas Martitz <kugel@rockbox.org>2009-10-20 21:54:59 +0000
commitd85c3ec41020a6c56b0d5d95a9ed790f57d73c6e (patch)
tree2f51ed47fee689024ed8c145634044362c8ed7d5
parent774bacc692b4d5c7b769bb88d24e182db9e4656f (diff)
downloadrockbox-d85c3ec41020a6c56b0d5d95a9ed790f57d73c6e.zip
rockbox-d85c3ec41020a6c56b0d5d95a9ed790f57d73c6e.tar.gz
rockbox-d85c3ec41020a6c56b0d5d95a9ed790f57d73c6e.tar.bz2
rockbox-d85c3ec41020a6c56b0d5d95a9ed790f57d73c6e.tar.xz
Convert lcd_activation callbacks to use the event system to allow for multiple parallel callbacks (for custom statusbar).
Increase maximum event count as we need more (I actually had a report about it during custom statusbar testing). Removed corresponding functions from the core and plugin api. Bump min version and sort. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23302 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/wps.c13
-rw-r--r--apps/plugin.c8
-rw-r--r--apps/plugin.h14
-rw-r--r--apps/plugins/mpegplayer/mpeg_settings.c7
-rw-r--r--apps/plugins/mpegplayer/mpegplayer.c9
-rw-r--r--docs/PLUGIN_API.new5
-rw-r--r--firmware/drivers/lcd-16bit-vert.c21
-rw-r--r--firmware/drivers/lcd-16bit.c21
-rw-r--r--firmware/drivers/lcd-1bit-vert.c19
-rw-r--r--firmware/events.c2
-rw-r--r--firmware/export/events.h1
-rw-r--r--firmware/export/lcd.h10
-rw-r--r--firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c2
-rw-r--r--firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c2
-rw-r--r--firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c2
-rw-r--r--firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c2
-rw-r--r--firmware/target/arm/ipod/video/lcd-video.c2
-rw-r--r--firmware/target/arm/iriver/h10/lcd-h10_20gb.c2
-rw-r--r--firmware/target/arm/lcd-c200_c200v2.c2
-rwxr-xr-xfirmware/target/arm/philips/sa9200/lcd-sa9200.c2
-rw-r--r--firmware/target/arm/s3c2440/lcd-s3c2440.c2
-rw-r--r--firmware/target/arm/samsung/yh820/lcd-yh820.c2
-rw-r--r--firmware/target/arm/samsung/yh925/lcd-yh925.c2
-rw-r--r--firmware/target/arm/sandisk/sansa-e200/lcd-e200.c2
-rw-r--r--firmware/target/arm/tcc77x/iaudio7/lcd-iaudio7.c2
-rw-r--r--firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c2
-rw-r--r--firmware/target/arm/tms320dm320/creative-zvm/lcd-creativezvm.c2
-rw-r--r--firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c2
-rw-r--r--firmware/target/coldfire/iaudio/x5/lcd-x5.c2
-rw-r--r--firmware/target/coldfire/iriver/h300/lcd-h300.c2
-rw-r--r--firmware/target/mips/ingenic_jz47xx/lcd-jz4740.c2
-rw-r--r--uisimulator/common/lcd-common.c6
32 files changed, 57 insertions, 117 deletions
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index 11ce946..6d9d844 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -562,8 +562,9 @@ static void play_hop(int direction)
* we suppress updates until the wps is activated again (the lcd driver will
* call this hook to issue an instant update)
* */
-static void wps_lcd_activation_hook(void)
+static void wps_lcd_activation_hook(void *param)
{
+ (void)param;
wps_state.do_full_update = true;
/* force timeout in wps main loop, so that the update is instantly */
queue_post(&button_queue, BUTTON_NONE, 0);
@@ -585,7 +586,7 @@ static void gwps_leave_wps(void)
viewportmanager_set_statusbar(oldbars);
#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
/* Play safe and unregister the hook */
- lcd_activation_set_hook(NULL);
+ remove_event(LCD_EVENT_ACTIVATION, wps_lcd_activation_hook);
#endif
/* unhandle statusbar update delay */
sb_skin_set_update_delay(DEFAULT_UPDATE_DELAY);
@@ -1164,13 +1165,9 @@ long gui_wps_show(void)
FOR_NB_SCREENS(i)
{
#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
- if (lcd_active()
-#ifdef HAVE_REMOTE_LCD
/* currently, all remotes are readable without backlight
* so still update those */
- || (i == SCREEN_REMOTE)
-#endif
- )
+ if (lcd_active() || (i != SCREEN_MAIN))
#endif
{
skin_update(&gui_wps[i], WPS_REFRESH_NON_STATIC);
@@ -1193,7 +1190,7 @@ long gui_wps_show(void)
restore = false;
restoretimer = RESTORE_WPS_INSTANTLY;
#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
- lcd_activation_set_hook(wps_lcd_activation_hook);
+ add_event(LCD_EVENT_ACTIVATION, false, wps_lcd_activation_hook);
#endif
/* we remove the update delay since it's not very usable in the wps,
* e.g. during volume changing or ffwd/rewind */
diff --git a/apps/plugin.c b/apps/plugin.c
index 77fb925..ae889d6 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -155,7 +155,6 @@ static const struct plugin_api rockbox_api = {
lcd_set_mode,
#endif
#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
- lcd_activation_set_hook,
&button_queue,
#endif
bidi_l2v,
@@ -255,6 +254,7 @@ static const struct plugin_api rockbox_api = {
button_status,
#ifdef HAVE_BUTTON_DATA
button_get_data,
+ button_status_wdata,
#endif
button_clear_queue,
button_queue_count,
@@ -376,6 +376,9 @@ static const struct plugin_api rockbox_api = {
__cyg_profile_func_enter,
__cyg_profile_func_exit,
#endif
+ add_event,
+ remove_event,
+ send_event,
#ifdef SIMULATOR
/* special simulator hooks */
@@ -668,9 +671,6 @@ static const struct plugin_api rockbox_api = {
appsversion,
/* new stuff at the end, sort into place next time
the API gets incompatible */
-#ifdef HAVE_BUTTON_DATA
- button_status_wdata,
-#endif
};
int plugin_load(const char* plugin, const void* parameter)
diff --git a/apps/plugin.h b/apps/plugin.h
index 6ff7e7e..7ea1943 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -133,12 +133,12 @@ void* plugin_get_buffer(size_t *buffer_size);
#define PLUGIN_MAGIC 0x526F634B /* RocK */
/* increase this every time the api struct changes */
-#define PLUGIN_API_VERSION 172
+#define PLUGIN_API_VERSION 173
/* update this to latest version if a change to the api struct breaks
backwards compatibility (and please take the opportunity to sort in any
new function which are "waiting" at the end of the function table) */
-#define PLUGIN_MIN_API_VERSION 172
+#define PLUGIN_MIN_API_VERSION 173
/* plugin return codes */
enum plugin_status {
@@ -244,7 +244,6 @@ struct plugin_api {
#endif
#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
- void (*lcd_activation_set_hook)(void (*enable_hook)(void));
struct event_queue *button_queue;
#endif
unsigned short *(*bidi_l2v)( const unsigned char *str, int orientation );
@@ -367,6 +366,7 @@ struct plugin_api {
int (*button_status)(void);
#ifdef HAVE_BUTTON_DATA
intptr_t (*button_get_data)(void);
+ int (*button_status_wdata)(int *pdata);
#endif
void (*button_clear_queue)(void);
int (*button_queue_count)(void);
@@ -500,6 +500,10 @@ struct plugin_api {
void (*profile_func_enter)(void *this_fn, void *call_site);
void (*profile_func_exit)(void *this_fn, void *call_site);
#endif
+ /* event api */
+ bool (*add_event)(unsigned short id, bool oneshot, void (*handler)(void *data));
+ void (*remove_event)(unsigned short id, void (*handler)(void *data));
+ void (*send_event)(unsigned short id, void *data);
#ifdef SIMULATOR
/* special simulator hooks */
@@ -837,10 +841,6 @@ struct plugin_api {
const char *appsversion;
/* new stuff at the end, sort into place next time
the API gets incompatible */
-
-#ifdef HAVE_BUTTON_DATA
- int (*button_status_wdata)(int *pdata);
-#endif
};
/* plugin header */
diff --git a/apps/plugins/mpegplayer/mpeg_settings.c b/apps/plugins/mpegplayer/mpeg_settings.c
index df926f4..eb55c14 100644
--- a/apps/plugins/mpegplayer/mpeg_settings.c
+++ b/apps/plugins/mpegplayer/mpeg_settings.c
@@ -599,8 +599,9 @@ static uint32_t increment_time(uint32_t val, int32_t amount, uint32_t range)
}
#if defined(HAVE_LCD_ENABLE) && defined(HAVE_LCD_COLOR)
-static void get_start_time_lcd_enable_hook(void)
+static void get_start_time_lcd_enable_hook(void *param)
{
+ (void)param;
rb->queue_post(rb->button_queue, LCD_ENABLE_EVENT_0, 0);
}
#endif /* HAVE_LCD_ENABLE */
@@ -619,7 +620,7 @@ static int get_start_time(uint32_t duration)
lcd_(update)();
#if defined(HAVE_LCD_ENABLE) && defined(HAVE_LCD_COLOR)
- rb->lcd_activation_set_hook(get_start_time_lcd_enable_hook);
+ rb->add_event(LCD_EVENT_ACTIVATION, false, get_start_time_lcd_enable_hook);
#endif
draw_slider(0, 100, &rc_bound);
@@ -810,7 +811,7 @@ static int get_start_time(uint32_t duration)
}
#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
- rb->lcd_activation_set_hook(NULL);
+ rb->remove_event(LCD_EVENT_ACTIVATION, get_start_time_lcd_enable_hook);
#endif
#ifndef HAVE_LCD_COLOR
stream_gray_show(false);
diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c
index 0cb5f94..7c52a47 100644
--- a/apps/plugins/mpegplayer/mpegplayer.c
+++ b/apps/plugins/mpegplayer/mpegplayer.c
@@ -652,8 +652,9 @@ static void draw_putsxy_oriented(int x, int y, const char *str)
#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
/* So we can refresh the overlay */
-static void wvs_lcd_enable_hook(void)
+static void wvs_lcd_enable_hook(void* param)
{
+ (void)param;
rb->queue_post(rb->button_queue, LCD_ENABLE_EVENT_1, 0);
}
#endif
@@ -665,11 +666,11 @@ static void wvs_backlight_on_video_mode(bool video_on)
/* backlight control in lib/helper.c */
backlight_force_on();
#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
- rb->lcd_activation_set_hook(NULL);
+ rb->remove_event(LCD_EVENT_ACTIVATION, wvs_lcd_enable_hook);
#endif
} else {
#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
- rb->lcd_activation_set_hook(wvs_lcd_enable_hook);
+ rb->add_event(LCD_EVENT_ACTIVATION, false, wvs_lcd_enable_hook);
#endif
/* Revert to user's backlight settings */
backlight_use_settings();
@@ -1671,7 +1672,7 @@ static void button_loop(void)
#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
/* Be sure hook is removed before exiting since the stop will put it
* back because of the backlight restore. */
- rb->lcd_activation_set_hook(NULL);
+ rb->remove_event(LCD_EVENT_ACTIVATION, wvs_lcd_enable_hook);
#endif
rb->lcd_setfont(FONT_UI);
diff --git a/docs/PLUGIN_API.new b/docs/PLUGIN_API.new
index 876af37..1989386 100644
--- a/docs/PLUGIN_API.new
+++ b/docs/PLUGIN_API.new
@@ -1384,11 +1384,6 @@ void lcd_set_drawmode(int mode)
\param mode
\description
-void lcd_activation_set_hook(void (*enable_hook)(void))
- \conditions !defined(HAVE_LCD_CHARCELLS) && (defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP))
- \param enable_hook
- \description
-
void lcd_set_foreground(unsigned foreground)
\group lcd
\conditions !defined(HAVE_LCD_CHARCELLS) && (LCD_DEPTH > 1)
diff --git a/firmware/drivers/lcd-16bit-vert.c b/firmware/drivers/lcd-16bit-vert.c
index 8875057..1e49bb3 100644
--- a/firmware/drivers/lcd-16bit-vert.c
+++ b/firmware/drivers/lcd-16bit-vert.c
@@ -75,27 +75,6 @@ static struct viewport* current_vp IDATA_ATTR = &default_vp;
struct viewport* current_vp IDATA_ATTR = &default_vp;
#endif
-
-/*** Helpers - consolidate optional code ***/
-#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
-static void (*lcd_activation_hook)(void) = NULL;
-
-void lcd_activation_set_hook(void (*func)(void))
-{
- lcd_activation_hook = func;
-}
-
-/* To be called by target driver after enabling display and refreshing it */
-void lcd_activation_call_hook(void)
-{
- void (*func)(void) = lcd_activation_hook;
-
- if (func != NULL)
- func();
-}
-
-#endif
-
/* LCD init */
void lcd_init(void)
{
diff --git a/firmware/drivers/lcd-16bit.c b/firmware/drivers/lcd-16bit.c
index 7238d7a..d1b417a 100644
--- a/firmware/drivers/lcd-16bit.c
+++ b/firmware/drivers/lcd-16bit.c
@@ -74,27 +74,6 @@ static struct viewport* current_vp IDATA_ATTR = &default_vp;
struct viewport* current_vp IDATA_ATTR = &default_vp;
#endif
-
-/*** Helpers - consolidate optional code ***/
-#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
-static void (*lcd_activation_hook)(void) = NULL;
-
-void lcd_activation_set_hook(void (*func)(void))
-{
- lcd_activation_hook = func;
-}
-
-/* To be called by target driver after enabling display and refreshing it */
-void lcd_activation_call_hook(void)
-{
- void (*func)(void) = lcd_activation_hook;
-
- if (func != NULL)
- func();
-}
-
-#endif
-
/* LCD init */
void lcd_init(void)
{
diff --git a/firmware/drivers/lcd-1bit-vert.c b/firmware/drivers/lcd-1bit-vert.c
index dd6c7cd..9607f28 100644
--- a/firmware/drivers/lcd-1bit-vert.c
+++ b/firmware/drivers/lcd-1bit-vert.c
@@ -91,25 +91,6 @@ void LCDFN(init)(void)
#endif
}
-#ifdef MAIN_LCD
-#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
-static void (*lcd_activation_hook)(void) = NULL;
-
-void lcd_activation_set_hook(void (*func)(void))
-{
- lcd_activation_hook = func;
-}
-
-void lcd_activation_call_hook(void)
-{
- void (*func)(void) = lcd_activation_hook;
-
- if (func != NULL)
- func();
-}
-#endif
-#endif
-
/*** parameter handling ***/
void LCDFN(set_drawmode)(int mode)
diff --git a/firmware/events.c b/firmware/events.c
index dca612b..74172e1 100644
--- a/firmware/events.c
+++ b/firmware/events.c
@@ -23,7 +23,7 @@
#include "events.h"
#include "panic.h"
-#define MAX_SYS_EVENTS 20
+#define MAX_SYS_EVENTS 28
struct sysevent {
unsigned short id;
diff --git a/firmware/export/events.h b/firmware/export/events.h
index 694566a..42ddf58 100644
--- a/firmware/export/events.h
+++ b/firmware/export/events.h
@@ -37,6 +37,7 @@
#define EVENT_CLASS_PLAYBACK 0x0200
#define EVENT_CLASS_BUFFERING 0x0400
#define EVENT_CLASS_GUI 0x0800
+#define EVENT_CLASS_LCD 0xf000
bool add_event(unsigned short id, bool oneshot, void (*handler)(void *data));
void remove_event(unsigned short id, void (*handler)(void *data));
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h
index 91217ff..89f3943 100644
--- a/firmware/export/lcd.h
+++ b/firmware/export/lcd.h
@@ -25,6 +25,7 @@
#include <stdbool.h>
#include "cpu.h"
#include "config.h"
+#include "events.h"
#define VP_FLAG_ALIGN_RIGHT 0x01
#define VP_FLAG_ALIGN_CENTER 0x02
@@ -426,13 +427,16 @@ extern void lcd_sleep(void);
* framebuffer data is synchronized */
/* Sansa Clip has these function in it's lcd driver, since it's the only
* 1-bit display featuring lcd_active, so far */
+
+enum {
+ LCD_EVENT_ACTIVATION = (EVENT_CLASS_LCD|1),
+};
+
extern bool lcd_active(void);
-extern void lcd_activation_set_hook(void (*enable_hook)(void));
-extern void lcd_activation_call_hook(void);
#endif
#ifdef HAVE_LCD_SHUTDOWN
-void lcd_shutdown(void);
+extern void lcd_shutdown(void);
#endif
/* Bitmap formats */
diff --git a/firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c b/firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c
index edc1d98..1ca26dd 100644
--- a/firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c
+++ b/firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c
@@ -172,7 +172,7 @@ void lcd_enable(bool enable)
ascodec_write(AS3514_DCDC15, 1);
lcd_write_command(LCD_SET_DISPLAY_ON);
- lcd_activation_call_hook();
+ send_event(LCD_EVENT_ACTIVATION, NULL);
}
else {
lcd_write_command(LCD_SET_DISPLAY_OFF);
diff --git a/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c b/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c
index a063ae4..7c3ccc2 100644
--- a/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c
+++ b/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c
@@ -372,7 +372,7 @@ void lcd_enable(bool on)
if(on)
{
_display_on();
- lcd_activation_call_hook();
+ send_event(LCD_EVENT_ACTIVATION, NULL);
}
else
{
diff --git a/firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c b/firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c
index d8cec64..21ecdf8 100644
--- a/firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c
+++ b/firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c
@@ -217,7 +217,7 @@ void lcd_enable(bool on)
lcd_write_reg(0x07, 0x17);
display_on = true;
lcd_update(); /* Resync display */
- lcd_activation_call_hook();
+ send_event(LCD_EVENT_ACTIVATION, NULL);
sleep(0);
}
diff --git a/firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c b/firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c
index c8d8b8a..fa1aed0 100644
--- a/firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c
+++ b/firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c
@@ -122,7 +122,7 @@ void lcd_enable(bool state)
lcd_powered = true;
lcd_on = true;
lcd_update();
- lcd_activation_call_hook();
+ send_event(LCD_EVENT_ACTIVATION, NULL);
}
else
{
diff --git a/firmware/target/arm/ipod/video/lcd-video.c b/firmware/target/arm/ipod/video/lcd-video.c
index ecd28bb..ea9738b 100644
--- a/firmware/target/arm/ipod/video/lcd-video.c
+++ b/firmware/target/arm/ipod/video/lcd-video.c
@@ -618,7 +618,7 @@ void lcd_awake(void)
tick_add_task(&lcd_tick);
wakeup_wait(&(lcd_state.initwakeup), TIMEOUT_BLOCK);
- lcd_activation_call_hook();
+ send_event(LCD_EVENT_ACTIVATION, NULL);
}
}
diff --git a/firmware/target/arm/iriver/h10/lcd-h10_20gb.c b/firmware/target/arm/iriver/h10/lcd-h10_20gb.c
index 4e6aeba..f6cf4cb 100644
--- a/firmware/target/arm/iriver/h10/lcd-h10_20gb.c
+++ b/firmware/target/arm/iriver/h10/lcd-h10_20gb.c
@@ -380,7 +380,7 @@ void lcd_enable(bool on)
/* Probably out of sync and we don't wanna pepper the code with
lcd_update() calls for this. */
lcd_update();
- lcd_activation_call_hook();
+ send_event(LCD_EVENT_ACTIVATION, NULL);
}
else
{
diff --git a/firmware/target/arm/lcd-c200_c200v2.c b/firmware/target/arm/lcd-c200_c200v2.c
index 3ba1bf0..62f1dc2 100644
--- a/firmware/target/arm/lcd-c200_c200v2.c
+++ b/firmware/target/arm/lcd-c200_c200v2.c
@@ -320,7 +320,7 @@ void lcd_enable(bool yesno)
{
lcd_send_command(R_STANDBY_OFF, 0);
lcd_send_command(R_DISPLAY_ON, 0);
- lcd_activation_call_hook();
+ send_event(LCD_EVENT_ACTIVATION, NULL);
}
else
{
diff --git a/firmware/target/arm/philips/sa9200/lcd-sa9200.c b/firmware/target/arm/philips/sa9200/lcd-sa9200.c
index 3937c07..51a3cf0 100755
--- a/firmware/target/arm/philips/sa9200/lcd-sa9200.c
+++ b/firmware/target/arm/philips/sa9200/lcd-sa9200.c
@@ -339,7 +339,7 @@ void lcd_enable(bool on)
/* Probably out of sync and we don't wanna pepper the code with
lcd_update() calls for this. */
lcd_update();
- lcd_activation_call_hook();
+ send_event(LCD_EVENT_ACTIVATION, NULL);
}
else
{
diff --git a/firmware/target/arm/s3c2440/lcd-s3c2440.c b/firmware/target/arm/s3c2440/lcd-s3c2440.c
index b9f76b7..d702b57 100644
--- a/firmware/target/arm/s3c2440/lcd-s3c2440.c
+++ b/firmware/target/arm/s3c2440/lcd-s3c2440.c
@@ -323,7 +323,7 @@ void lcd_enable(bool state)
lcd_on = true;
lcd_update();
- lcd_activation_call_hook();
+ send_event(LCD_EVENT_ACTIVATION, NULL);
}
else
{
diff --git a/firmware/target/arm/samsung/yh820/lcd-yh820.c b/firmware/target/arm/samsung/yh820/lcd-yh820.c
index 76ecdd2..f7d971a 100644
--- a/firmware/target/arm/samsung/yh820/lcd-yh820.c
+++ b/firmware/target/arm/samsung/yh820/lcd-yh820.c
@@ -226,7 +226,7 @@ void lcd_enable(bool yesno)
{
lcd_send_command(R_STANDBY_OFF);
lcd_send_command(R_DISPLAY_ON);
- lcd_activation_call_hook();
+ send_event(LCD_EVENT_ACTIVATION, NULL);
}
else
{
diff --git a/firmware/target/arm/samsung/yh925/lcd-yh925.c b/firmware/target/arm/samsung/yh925/lcd-yh925.c
index 7509def..9ffcddf 100644
--- a/firmware/target/arm/samsung/yh925/lcd-yh925.c
+++ b/firmware/target/arm/samsung/yh925/lcd-yh925.c
@@ -492,7 +492,7 @@ void lcd_enable(bool on)
/* Probably out of sync and we don't wanna pepper the code with
lcd_update() calls for this. */
lcd_update();
- lcd_activation_call_hook();
+ send_event(LCD_EVENT_ACTIVATION, NULL);
}
else
{
diff --git a/firmware/target/arm/sandisk/sansa-e200/lcd-e200.c b/firmware/target/arm/sandisk/sansa-e200/lcd-e200.c
index f31e079..03f6a1b 100644
--- a/firmware/target/arm/sandisk/sansa-e200/lcd-e200.c
+++ b/firmware/target/arm/sandisk/sansa-e200/lcd-e200.c
@@ -448,7 +448,7 @@ void lcd_enable(bool on)
DEV_EN |= DEV_LCD; /* Enable LCD controller */
lcd_display_on(); /* Turn on display */
lcd_update(); /* Resync display */
- lcd_activation_call_hook();
+ send_event(LCD_EVENT_ACTIVATION, NULL);
LCD_REG_6 |= 1; /* Restart DMA */
sleep(HZ/50); /* Wait for a frame to be written */
}
diff --git a/firmware/target/arm/tcc77x/iaudio7/lcd-iaudio7.c b/firmware/target/arm/tcc77x/iaudio7/lcd-iaudio7.c
index 6da0d2c..5d2a2b8 100644
--- a/firmware/target/arm/tcc77x/iaudio7/lcd-iaudio7.c
+++ b/firmware/target/arm/tcc77x/iaudio7/lcd-iaudio7.c
@@ -143,7 +143,7 @@ void lcd_enable(bool on)
if (on) {
_display_on();
- lcd_activation_call_hook();
+ send_event(LCD_EVENT_ACTIVATION, NULL);
} else {
/** Off sequence according to datasheet, p. 130 **/
lcd_write_reg(R_FRAME_CYCLE_CONTROL, 0x0002); /* EQ=0, 18 clks/line */
diff --git a/firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c b/firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c
index 034a53a..d5a7e2f 100644
--- a/firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c
+++ b/firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c
@@ -209,7 +209,7 @@ void lcd_enable(bool on)
lcd_display_on();
LCDC_CTRL |= 1; /* controller enable */
lcd_update(); /* Resync display */
- lcd_activation_call_hook();
+ send_event(LCD_EVENT_ACTIVATION, NULL);
}
else
{
diff --git a/firmware/target/arm/tms320dm320/creative-zvm/lcd-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/lcd-creativezvm.c
index e77c3a2..3f1e621 100644
--- a/firmware/target/arm/tms320dm320/creative-zvm/lcd-creativezvm.c
+++ b/firmware/target/arm/tms320dm320/creative-zvm/lcd-creativezvm.c
@@ -237,7 +237,7 @@ return;
{
lcd_display_on(false); /* Turn on display */
lcd_update(); /* Resync display */
- lcd_activation_call_hook();
+ send_event(LCD_EVENT_ACTIVATION, NULL);
}
else
{
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c
index 201b6e8..ac7754f 100644
--- a/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c
+++ b/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c
@@ -98,7 +98,7 @@ void lcd_awake(void)
sleep(HZ/10);
- lcd_activation_call_hook();
+ send_event(LCD_EVENT_ACTIVATION, NULL);
}
}
#endif
diff --git a/firmware/target/coldfire/iaudio/x5/lcd-x5.c b/firmware/target/coldfire/iaudio/x5/lcd-x5.c
index 98eb5de..e1504b6 100644
--- a/firmware/target/coldfire/iaudio/x5/lcd-x5.c
+++ b/firmware/target/coldfire/iaudio/x5/lcd-x5.c
@@ -397,7 +397,7 @@ void lcd_enable(bool on)
/* Probably out of sync and we don't wanna pepper the code with
lcd_update() calls for this. */
lcd_update();
- lcd_activation_call_hook();
+ send_event(LCD_EVENT_ACTIVATION, NULL);
}
else
{
diff --git a/firmware/target/coldfire/iriver/h300/lcd-h300.c b/firmware/target/coldfire/iriver/h300/lcd-h300.c
index 36f340e..ea0819a 100644
--- a/firmware/target/coldfire/iriver/h300/lcd-h300.c
+++ b/firmware/target/coldfire/iriver/h300/lcd-h300.c
@@ -280,7 +280,7 @@ void lcd_enable(bool on)
if (on)
{
_display_on();
- lcd_activation_call_hook();
+ send_event(LCD_EVENT_ACTIVATION, NULL);
}
else
{
diff --git a/firmware/target/mips/ingenic_jz47xx/lcd-jz4740.c b/firmware/target/mips/ingenic_jz47xx/lcd-jz4740.c
index edde538..99ffcf2 100644
--- a/firmware/target/mips/ingenic_jz47xx/lcd-jz4740.c
+++ b/firmware/target/mips/ingenic_jz47xx/lcd-jz4740.c
@@ -55,7 +55,7 @@ void lcd_enable(bool state)
{
lcd_on();
#ifdef HAVE_LCD_ENABLE
- lcd_activation_call_hook();
+ send_event(LCD_EVENT_ACTIVATION, NULL);
#endif
}
else
diff --git a/uisimulator/common/lcd-common.c b/uisimulator/common/lcd-common.c
index 52db776..2acf4b3 100644
--- a/uisimulator/common/lcd-common.c
+++ b/uisimulator/common/lcd-common.c
@@ -22,7 +22,9 @@
*
****************************************************************************/
+#include <stdbool.h>
#include "config.h"
+#include "system.h"
#include "lcd.h"
#ifdef HAVE_LCD_ENABLE
@@ -82,7 +84,7 @@ void lcd_awake(void)
{
if (lcd_sleeping)
{
- lcd_activation_call_hook();
+ send_event(LCD_EVENT_ACTIVATION, NULL);
lcd_sleeping = false;
}
}
@@ -96,7 +98,7 @@ void lcd_enable(bool on)
/* lcd_awake will handle the activation call */
lcd_awake();
#else
- lcd_activation_call_hook();
+ send_event(LCD_EVENT_ACTIVATION, NULL);
#endif
}
lcd_enabled = on;