forked from len0rd/rockbox
Fixed USB handling, and brought back the special mode
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5025 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
b9062aef7c
commit
56fd6f9316
1 changed files with 18 additions and 11 deletions
|
@ -238,9 +238,13 @@ static int scrollit(void)
|
||||||
b = rb->button_get_w_tmo(HZ/10);
|
b = rb->button_get_w_tmo(HZ/10);
|
||||||
if ( b == (BUTTON_OFF|BUTTON_REL) )
|
if ( b == (BUTTON_OFF|BUTTON_REL) )
|
||||||
return 0;
|
return 0;
|
||||||
else if ( b == (BUTTON_ON|BUTTON_REL) )
|
|
||||||
|
if ( b == (BUTTON_ON|BUTTON_REL) )
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
if ( rb->default_event_handler(b) == SYS_USB_CONNECTED )
|
||||||
|
return -1;
|
||||||
|
|
||||||
rb->lcd_clear_display();
|
rb->lcd_clear_display();
|
||||||
|
|
||||||
for(i=0, yy=y, xx=x; i< LETTERS_ON_SCREEN; i++) {
|
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);
|
b = rb->button_get_w_tmo(HZ/10);
|
||||||
if ( b == (BUTTON_OFF|BUTTON_REL) )
|
if ( b == (BUTTON_OFF|BUTTON_REL) )
|
||||||
return PLUGIN_OK;
|
return 0;
|
||||||
else if(b != BUTTON_NONE)
|
|
||||||
timeout=20;
|
|
||||||
|
|
||||||
if ( rb->default_event_handler(b) == SYS_USB_CONNECTED) {
|
if ( b == (BUTTON_ON|BUTTON_REL) )
|
||||||
return PLUGIN_USB_CONNECTED;
|
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;
|
y+= speed[ysanke&15] + values[NUM_YADD].num;
|
||||||
x+= speed[xsanke&15] + values[NUM_XADD].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);
|
rb->sleep(HZ);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
h= loopit();
|
h = loopit();
|
||||||
if(h)
|
if (h > 0)
|
||||||
h = scrollit();
|
h = scrollit();
|
||||||
} while(h);
|
} while(h > 0);
|
||||||
|
|
||||||
rb->lcd_setfont(FONT_UI);
|
rb->lcd_setfont(FONT_UI);
|
||||||
|
|
||||||
return false;
|
return h = 0 ? PLUGIN_OK : PLUGIN_USB_CONNECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue