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/plasma.c | |
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/plasma.c')
-rw-r--r-- | apps/plugins/plasma.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/apps/plugins/plasma.c b/apps/plugins/plasma.c index 35bc03ba1f..637d948f3d 100644 --- a/apps/plugins/plasma.c +++ b/apps/plugins/plasma.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #include "plugin.h" | 27 | #include "plugin.h" |
28 | #include "lib/helper.h" | 28 | #include "lib/helper.h" |
29 | #include "lib/pluginlib_actions.h" | 29 | #include "lib/pluginlib_actions.h" |
30 | #include "lib/pluginlib_exit.h" | ||
31 | 30 | ||
32 | #ifdef HAVE_LCD_BITMAP | 31 | #ifdef HAVE_LCD_BITMAP |
33 | 32 | ||
@@ -36,6 +35,7 @@ | |||
36 | #endif | 35 | #endif |
37 | #include "lib/fixedpoint.h" | 36 | #include "lib/fixedpoint.h" |
38 | 37 | ||
38 | PLUGIN_HEADER | ||
39 | 39 | ||
40 | /******************************* Globals ***********************************/ | 40 | /******************************* Globals ***********************************/ |
41 | 41 | ||
@@ -131,8 +131,10 @@ static void shades_generate(void) | |||
131 | } | 131 | } |
132 | #endif | 132 | #endif |
133 | 133 | ||
134 | void cleanup(void) | 134 | void cleanup(void *parameter) |
135 | { | 135 | { |
136 | (void)parameter; | ||
137 | |||
136 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | 138 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ |
137 | if (boosted) | 139 | if (boosted) |
138 | rb->cpu_boost(false); | 140 | rb->cpu_boost(false); |
@@ -142,9 +144,6 @@ void cleanup(void) | |||
142 | #endif | 144 | #endif |
143 | /* Turn on backlight timeout (revert to settings) */ | 145 | /* Turn on backlight timeout (revert to settings) */ |
144 | backlight_use_settings(); /* backlight control in lib/helper.c */ | 146 | backlight_use_settings(); /* backlight control in lib/helper.c */ |
145 | #if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256) | ||
146 | rb->lcd_set_mode(LCD_MODE_RGB565); | ||
147 | #endif | ||
148 | } | 147 | } |
149 | 148 | ||
150 | /* | 149 | /* |
@@ -181,15 +180,10 @@ int main(void) | |||
181 | /* get the remainder of the plugin buffer */ | 180 | /* get the remainder of the plugin buffer */ |
182 | gbuf = (unsigned char *) rb->plugin_get_buffer(&gbuf_size); | 181 | gbuf = (unsigned char *) rb->plugin_get_buffer(&gbuf_size); |
183 | 182 | ||
184 | if (!grey_init(gbuf, gbuf_size, GREY_ON_COP, LCD_WIDTH, LCD_HEIGHT, NULL)) | 183 | grey_init(gbuf, gbuf_size, GREY_ON_COP, LCD_WIDTH, LCD_HEIGHT, NULL); |
185 | { | ||
186 | rb->splash(HZ, "Couldn't init greyscale display"); | ||
187 | return PLUGIN_ERROR; | ||
188 | } | ||
189 | /* switch on greyscale overlay */ | 184 | /* switch on greyscale overlay */ |
190 | grey_show(true); | 185 | grey_show(true); |
191 | #endif | 186 | #endif |
192 | atexit(cleanup); | ||
193 | sp1 = 4; | 187 | sp1 = 4; |
194 | sp2 = 2; | 188 | sp2 = 2; |
195 | sp3 = 4; | 189 | sp3 = 4; |
@@ -267,6 +261,7 @@ int main(void) | |||
267 | { | 261 | { |
268 | case PLA_EXIT: | 262 | case PLA_EXIT: |
269 | case PLA_CANCEL: | 263 | case PLA_CANCEL: |
264 | cleanup(NULL); | ||
270 | return PLUGIN_OK; | 265 | return PLUGIN_OK; |
271 | break; | 266 | break; |
272 | 267 | ||
@@ -304,7 +299,9 @@ int main(void) | |||
304 | #endif | 299 | #endif |
305 | 300 | ||
306 | default: | 301 | default: |
307 | exit_on_usb(action); | 302 | if (rb->default_event_handler_ex(action, cleanup, NULL) |
303 | == SYS_USB_CONNECTED) | ||
304 | return PLUGIN_USB_CONNECTED; | ||
308 | break; | 305 | break; |
309 | } | 306 | } |
310 | } | 307 | } |
@@ -314,6 +311,8 @@ int main(void) | |||
314 | 311 | ||
315 | enum plugin_status plugin_start(const void* parameter) | 312 | enum plugin_status plugin_start(const void* parameter) |
316 | { | 313 | { |
314 | int ret; | ||
315 | |||
317 | (void)parameter; | 316 | (void)parameter; |
318 | #if LCD_DEPTH > 1 | 317 | #if LCD_DEPTH > 1 |
319 | rb->lcd_set_backdrop(NULL); | 318 | rb->lcd_set_backdrop(NULL); |
@@ -324,7 +323,14 @@ enum plugin_status plugin_start(const void* parameter) | |||
324 | #if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256) | 323 | #if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256) |
325 | rb->lcd_set_mode(LCD_MODE_PAL256); | 324 | rb->lcd_set_mode(LCD_MODE_PAL256); |
326 | #endif | 325 | #endif |
327 | return main(); | 326 | |
327 | ret = main(); | ||
328 | |||
329 | #if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256) | ||
330 | rb->lcd_set_mode(LCD_MODE_RGB565); | ||
331 | #endif | ||
332 | |||
333 | return ret; | ||
328 | } | 334 | } |
329 | 335 | ||
330 | #endif /* HAVE_LCD_BITMAP */ | 336 | #endif /* HAVE_LCD_BITMAP */ |