summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2006-01-23 23:53:22 +0000
committerJens Arnold <amiconn@rockbox.org>2006-01-23 23:53:22 +0000
commitef4241a2ee20885ab6957ac842ca46096a8f96f5 (patch)
treecf5a16ad4f8c6e33bbff61f4c4e959bcf2ac80a0
parentafe36f42676dd5bd6bdcf16b02aa0139bb625b97 (diff)
downloadrockbox-ef4241a2ee20885ab6957ac842ca46096a8f96f5.tar.gz
rockbox-ef4241a2ee20885ab6957ac842ca46096a8f96f5.tar.bz2
rockbox-ef4241a2ee20885ab6957ac842ca46096a8f96f5.zip
Fixed USB handling in grayscale library mode.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8435 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/cube.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/apps/plugins/cube.c b/apps/plugins/cube.c
index 4279a04ac6..57003a0eb8 100644
--- a/apps/plugins/cube.c
+++ b/apps/plugins/cube.c
@@ -477,6 +477,17 @@ static void cube_draw(void)
}
}
+void cleanup(void *parameter)
+{
+ (void)parameter;
+
+#ifdef USE_GSLIB
+ gray_release();
+#elif defined HAVE_LCD_CHARCELLS
+ pgfx_release();
+#endif
+}
+
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
{
char buffer[30];
@@ -753,27 +764,20 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
break;
default:
- if (rb->default_event_handler(button) == SYS_USB_CONNECTED)
- {
-#ifdef HAVE_LCD_CHARCELLS
- pgfx_release();
-#elif defined(USE_GSLIB)
- gray_release();
-#endif
+ if (rb->default_event_handler_ex(button, cleanup, NULL)
+ == SYS_USB_CONNECTED)
return PLUGIN_USB_CONNECTED;
- }
break;
}
if (button != BUTTON_NONE)
lastbutton = button;
}
-
-#ifdef HAVE_LCD_CHARCELLS
- pgfx_release();
-#elif defined(USE_GSLIB)
+
+#ifdef USE_GSLIB
gray_release();
+#elif defined(HAVE_LCD_CHARCELLS)
+ pgfx_release();
#endif
-
return PLUGIN_OK;
}