diff options
| author | Jens Arnold <amiconn@rockbox.org> | 2004-08-30 17:21:15 +0000 |
|---|---|---|
| committer | Jens Arnold <amiconn@rockbox.org> | 2004-08-30 17:21:15 +0000 |
| commit | 56fd6f9316ee196bfd16a2f102469cb6b040d397 (patch) | |
| tree | de95d49233dc341763c1a27a6ddaa3c96ab42ff4 /apps | |
| parent | b9062aef7ccb06a055d0e6b64e8a404a89d1729a (diff) | |
| download | rockbox-56fd6f9316ee196bfd16a2f102469cb6b040d397.zip rockbox-56fd6f9316ee196bfd16a2f102469cb6b040d397.tar.gz rockbox-56fd6f9316ee196bfd16a2f102469cb6b040d397.tar.bz2 rockbox-56fd6f9316ee196bfd16a2f102469cb6b040d397.tar.xz | |
Fixed USB handling, and brought back the special mode
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5025 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/plugins/bounce.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/apps/plugins/bounce.c b/apps/plugins/bounce.c index e31c15e..d424474 100644 --- a/apps/plugins/bounce.c +++ b/apps/plugins/bounce.c @@ -238,9 +238,13 @@ static int scrollit(void) b = rb->button_get_w_tmo(HZ/10); if ( b == (BUTTON_OFF|BUTTON_REL) ) return 0; - else if ( b == (BUTTON_ON|BUTTON_REL) ) + + if ( b == (BUTTON_ON|BUTTON_REL) ) return 1; + if ( rb->default_event_handler(b) == SYS_USB_CONNECTED ) + return -1; + rb->lcd_clear_display(); for(i=0, yy=y, xx=x; i< LETTERS_ON_SCREEN; i++) { @@ -290,13 +294,16 @@ static int loopit(void) { b = rb->button_get_w_tmo(HZ/10); if ( b == (BUTTON_OFF|BUTTON_REL) ) - return PLUGIN_OK; - else if(b != BUTTON_NONE) - timeout=20; + return 0; - if ( rb->default_event_handler(b) == SYS_USB_CONNECTED) { - return PLUGIN_USB_CONNECTED; - } + if ( b == (BUTTON_ON|BUTTON_REL) ) + return 1; + + if ( rb->default_event_handler(b) == SYS_USB_CONNECTED ) + return -1; + + if ( b != BUTTON_NONE ) + timeout=20; y+= speed[ysanke&15] + values[NUM_YADD].num; x+= speed[xsanke&15] + values[NUM_XADD].num; @@ -388,14 +395,14 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) rb->sleep(HZ); do { - h= loopit(); - if(h) + h = loopit(); + if (h > 0) h = scrollit(); - } while(h); + } while(h > 0); rb->lcd_setfont(FONT_UI); - return false; + return h = 0 ? PLUGIN_OK : PLUGIN_USB_CONNECTED; } #endif |