From 93cb949372630d807615f53a8a6379937ed6819f Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Mon, 23 Aug 2010 17:12:26 +0000 Subject: 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 --- apps/plugins/greyscale.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'apps/plugins/greyscale.c') diff --git a/apps/plugins/greyscale.c b/apps/plugins/greyscale.c index 33254439b6..73dd98b216 100644 --- a/apps/plugins/greyscale.c +++ b/apps/plugins/greyscale.c @@ -27,7 +27,7 @@ #if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH < 4) #include "lib/grey.h" - +PLUGIN_HEADER /* variable button definitions */ #if CONFIG_KEYPAD == RECORDER_PAD @@ -316,7 +316,9 @@ int main(void) button = rb->button_get(true); - exit_on_usb(button); + if (rb->default_event_handler_ex(button, cleanup, NULL) + == SYS_USB_CONNECTED) + return PLUGIN_USB_CONNECTED; if (button & GREYSCALE_SHIFT) { @@ -367,6 +369,8 @@ int main(void) case GREYSCALE_RC_OFF: #endif case GREYSCALE_OFF: + + cleanup(NULL); return PLUGIN_OK; } } @@ -378,7 +382,6 @@ enum plugin_status plugin_start(const void* parameter) { (void)parameter; - atexit(cleanup); return main(); } -- cgit v1.2.3