diff options
author | Jens Arnold <amiconn@rockbox.org> | 2005-11-21 23:55:39 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2005-11-21 23:55:39 +0000 |
commit | b51f7dfc9b507ab9db12fe90b2ddad708f435e06 (patch) | |
tree | efcef3411689401da21795d700a0741f8ab1072b /uisimulator/win32/uisw32.c | |
parent | e68680ac310adb8373c9f3a5194466766d64cf37 (diff) | |
download | rockbox-b51f7dfc9b507ab9db12fe90b2ddad708f435e06.tar.gz rockbox-b51f7dfc9b507ab9db12fe90b2ddad708f435e06.zip |
Backlight handling: * Added 'Caption Backlight' and 'Backlight On When Charging' for the iriver remote LCD. * Enabled the backlight code for the simulator, and prepared backlight simulation. It's only a stub atm, writing messages to the console window. * Added tick task handling to the simulators for this to work. * Code cleanup in backlight.c, less dead code.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8034 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/win32/uisw32.c')
-rw-r--r-- | uisimulator/win32/uisw32.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/uisimulator/win32/uisw32.c b/uisimulator/win32/uisw32.c index d098c6ef24..b31eccf794 100644 --- a/uisimulator/win32/uisw32.c +++ b/uisimulator/win32/uisw32.c | |||
@@ -36,7 +36,8 @@ | |||
36 | 36 | ||
37 | // extern functions | 37 | // extern functions |
38 | extern void app_main (void *); // mod entry point | 38 | extern void app_main (void *); // mod entry point |
39 | extern void new_key(int key); | 39 | extern void new_key(int key); |
40 | extern void sim_tick_tasks(void); | ||
40 | 41 | ||
41 | void button_event(int key, bool pressed); | 42 | void button_event(int key, bool pressed); |
42 | 43 | ||
@@ -67,12 +68,18 @@ LRESULT CALLBACK GUIWndProc ( | |||
67 | static HDC hMemDc; | 68 | static HDC hMemDc; |
68 | 69 | ||
69 | static LARGE_INTEGER persec, tick1, ticknow; | 70 | static LARGE_INTEGER persec, tick1, ticknow; |
71 | long new_tick; | ||
70 | 72 | ||
71 | switch (uMsg) | 73 | switch (uMsg) |
72 | { | 74 | { |
73 | case WM_TIMER: | 75 | case WM_TIMER: |
74 | QueryPerformanceCounter(&ticknow); | 76 | QueryPerformanceCounter(&ticknow); |
75 | current_tick = ((ticknow.QuadPart-tick1.QuadPart)*HZ)/persec.QuadPart; | 77 | new_tick = ((ticknow.QuadPart-tick1.QuadPart)*HZ)/persec.QuadPart; |
78 | if (new_tick != current_tick) | ||
79 | { | ||
80 | sim_tick_tasks(); | ||
81 | current_tick = new_tick; | ||
82 | } | ||
76 | return TRUE; | 83 | return TRUE; |
77 | case WM_ACTIVATE: | 84 | case WM_ACTIVATE: |
78 | if (LOWORD(wParam) == WA_ACTIVE || LOWORD(wParam) == WA_CLICKACTIVE) | 85 | if (LOWORD(wParam) == WA_ACTIVE || LOWORD(wParam) == WA_CLICKACTIVE) |