|
amiconn: apps/plugins battery_test.c,1.6,1.7: msg#00196systems.archos.rockbox.cvs
Update of /cvsroot/rockbox/apps/plugins In directory labb:/tmp/cvs-serv12978/apps/plugins Modified Files: battery_test.c Log Message: Battery_test plugin: (1) Fixed the button handling to work as intended. (2) Corrected the playback buffer time calculation. (3) Display info about dummy file creation for MMC (Ondio). Index: battery_test.c =================================================================== RCS file: /cvsroot/rockbox/apps/plugins/battery_test.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- battery_test.c 16 Oct 2004 00:07:43 -0000 1.6 +++ battery_test.c 27 Jan 2005 23:22:06 -0000 1.7 @@ -31,8 +31,7 @@ /* variable button definitions */ #if CONFIG_KEYPAD == RECORDER_PAD -#define BATTERY_TEST_QUIT BUTTON_ON -#define BATTERY_TEST_QUIT2 BUTTON_OFF +#define BATTERY_TEST_QUIT BUTTON_OFF #elif CONFIG_KEYPAD == ONDIO_PAD #define BATTERY_TEST_QUIT BUTTON_OFF #elif CONFIG_KEYPAD == PLAYER_PAD @@ -48,6 +47,11 @@ { int f; buffer = rb->plugin_get_mp3_buffer(&buffersize); + +#ifdef HAVE_MMC + /* present info what's going on. MMC is slow. */ + rb->splash(0, true, "Creating dummy file."); +#endif /* create a big dummy file */ f = rb->creat("/battery.dummy", 0); @@ -101,24 +105,15 @@ t->tm_hour, t->tm_min, t->tm_sec, batt); rb->splash(0, true, buf); - /* simulate 128kbit/s (16kbyte/s) playback duration */ - do { - button = rb->button_get_w_tmo(HZ * (buffersize / 16384) - HZ*10); - - switch (button) { - /* Check if we shall exit the plugin */ - case BATTERY_TEST_QUIT: -#ifdef BATTERY_TEST_QUIT2 - case BATTERY_TEST_QUIT2: -#endif - return PLUGIN_OK; - - default: - if (rb->default_event_handler(button) == SYS_USB_CONNECTED) - return PLUGIN_USB_CONNECTED; - break; - } - } while (!(button&(BUTTON_REL|BUTTON_REPEAT))); + /* simulate 128 kbit/s (16000 byte/s) playback duration */ + rb->button_clear_queue(); + button = rb->button_get_w_tmo(HZ * buffersize / 16000) - HZ*10); + + if (button == BATTERY_TEST_QUIT) + return PLUGIN_OK; + + if (rb->default_event_handler(button) == SYS_USB_CONNECTED) + return PLUGIN_USB_CONNECTED; /* simulate filling the mp3 buffer */ f = rb->open("/battery.dummy", O_RDONLY); _______________________________________________ http://cool.haxx.se/mailman/listinfo/rockbox-cvs |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | zagor: apps dbtree.c,1.9,1.10 dbtree.h,1.5,1.6: 00196, cvs |
|---|---|
| Next by Date: | amiconn: apps/plugins battery_test.c,1.7,1.8: 00196, cvs |
| Previous by Thread: | zagor: apps dbtree.c,1.9,1.10 dbtree.h,1.5,1.6i: 00196, cvs |
| Next by Thread: | amiconn: apps/plugins battery_test.c,1.7,1.8: 00196, cvs |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |