diff options
author | Thomas Martitz <kugel@rockbox.org> | 2010-08-23 17:12:26 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2010-08-23 17:12:26 +0000 |
commit | 93cb949372630d807615f53a8a6379937ed6819f (patch) | |
tree | 2dcb5001a9247447a1c64fd0129e64b9d8aba4e6 /apps/plugins/clock | |
parent | abdc5935beb7dc3fa63bffeec584921ad2a4c8bd (diff) | |
download | rockbox-93cb949372630d807615f53a8a6379937ed6819f.tar.gz rockbox-93cb949372630d807615f53a8a6379937ed6819f.zip |
Revert "Introduce plugin_crt0.c that every plugin links."
Too much errors and no time to fix them now.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27863 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/clock')
-rw-r--r-- | apps/plugins/clock/clock.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/apps/plugins/clock/clock.c b/apps/plugins/clock/clock.c index 8a1a55e17f..f06f3e15e4 100644 --- a/apps/plugins/clock/clock.c +++ b/apps/plugins/clock/clock.c | |||
@@ -22,7 +22,6 @@ | |||
22 | #include "plugin.h" | 22 | #include "plugin.h" |
23 | #include "time.h" | 23 | #include "time.h" |
24 | #include "lib/pluginlib_actions.h" | 24 | #include "lib/pluginlib_actions.h" |
25 | #include "lib/pluginlib_exit.h" | ||
26 | #include "lib/xlcd.h" | 25 | #include "lib/xlcd.h" |
27 | 26 | ||
28 | #include "clock.h" | 27 | #include "clock.h" |
@@ -31,7 +30,7 @@ | |||
31 | #include "clock_menu.h" | 30 | #include "clock_menu.h" |
32 | #include "clock_settings.h" | 31 | #include "clock_settings.h" |
33 | 32 | ||
34 | 33 | PLUGIN_HEADER | |
35 | 34 | ||
36 | /* Keymaps */ | 35 | /* Keymaps */ |
37 | const struct button_mapping* plugin_contexts[]={ | 36 | const struct button_mapping* plugin_contexts[]={ |
@@ -57,8 +56,9 @@ const struct button_mapping* plugin_contexts[]={ | |||
57 | /************************** | 56 | /************************** |
58 | * Cleanup on plugin return | 57 | * Cleanup on plugin return |
59 | *************************/ | 58 | *************************/ |
60 | void cleanup(void) | 59 | void cleanup(void *parameter) |
61 | { | 60 | { |
61 | (void)parameter; | ||
62 | clock_draw_restore_colors(); | 62 | clock_draw_restore_colors(); |
63 | if(clock_settings.general.save_settings == 1) | 63 | if(clock_settings.general.save_settings == 1) |
64 | save_settings(); | 64 | save_settings(); |
@@ -115,7 +115,6 @@ enum plugin_status plugin_start(const void* parameter){ | |||
115 | struct counter counter; | 115 | struct counter counter; |
116 | bool exit_clock = false; | 116 | bool exit_clock = false; |
117 | (void)parameter; | 117 | (void)parameter; |
118 | atexit(cleanup); | ||
119 | 118 | ||
120 | #if LCD_DEPTH > 1 | 119 | #if LCD_DEPTH > 1 |
121 | rb->lcd_set_backdrop(NULL); | 120 | rb->lcd_set_backdrop(NULL); |
@@ -175,7 +174,9 @@ enum plugin_status plugin_start(const void* parameter){ | |||
175 | exit_clock=main_menu(); | 174 | exit_clock=main_menu(); |
176 | break; | 175 | break; |
177 | default: | 176 | default: |
178 | exit_on_usb(button); | 177 | if(rb->default_event_handler_ex(button, cleanup, NULL) |
178 | == SYS_USB_CONNECTED) | ||
179 | return PLUGIN_USB_CONNECTED; | ||
179 | if(time.second != last_second){ | 180 | if(time.second != last_second){ |
180 | last_second=time.second; | 181 | last_second=time.second; |
181 | redraw=true; | 182 | redraw=true; |
@@ -192,5 +193,6 @@ enum plugin_status plugin_start(const void* parameter){ | |||
192 | } | 193 | } |
193 | } | 194 | } |
194 | 195 | ||
196 | cleanup(NULL); | ||
195 | return PLUGIN_OK; | 197 | return PLUGIN_OK; |
196 | } | 198 | } |