1
0
Fork 0
forked from len0rd/rockbox

Fix test_boost boost handling. Also show the number of loops per second.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25429 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Martitz 2010-04-01 17:50:36 +00:00
parent eef7f343c2
commit 44e4839366
2 changed files with 24 additions and 9 deletions

View file

@ -99,6 +99,7 @@ starfield,demos
stats,apps stats,apps
stopwatch,apps stopwatch,apps
sudoku,games sudoku,games
test_boost,apps
test_codec,viewers test_codec,viewers
test_disk,apps test_disk,apps
test_fps,apps test_fps,apps

View file

@ -29,32 +29,46 @@ enum plugin_status plugin_start(const void* parameter)
bool done = false; bool done = false;
bool boost = false; bool boost = false;
int count = 0; int count = 0;
int last_count = 0;
int last_tick = *rb->current_tick;
int per_sec = 0;
rb->lcd_setfont(FONT_SYSFIXED); rb->lcd_setfont(FONT_SYSFIXED);
while (!done) while (!done)
{ {
char buf[32];
int j,x; int j,x;
for (j=1; j<100000; j++) for (j=1; j<100000; j++)
x = j*11; x = j*11;
rb->lcd_clear_display(); rb->screens[0]->clear_display();
rb->snprintf(buf,sizeof buf, "%s %d",boost?"boost":"normal",count); rb->screens[0]->putsf(0, 0, "%s: %d",boost?"boost":"normal",count);
rb->lcd_putsxy(0, 0, buf); if (TIME_AFTER(*rb->current_tick, last_tick+HZ))
rb->lcd_update(); {
last_tick = *rb->current_tick;
per_sec = count-last_count;
last_count = count;
}
rb->screens[0]->putsf(0, 1, "loops/s: %d", per_sec);
rb->screens[0]->update();
count++; count++;
int button = rb->button_get(false); int button = rb->button_get(false);
switch (button) switch (button)
{ {
case BUTTON_UP: case BUTTON_UP:
boost = true; if (!boost)
rb->cpu_boost(boost); {
rb->cpu_boost(true);
boost = true;
}
break; break;
case BUTTON_DOWN: case BUTTON_DOWN:
boost = false; if (boost)
rb->cpu_boost(boost); {
rb->cpu_boost(false);
boost = false;
}
break; break;
case BUTTON_LEFT: case BUTTON_LEFT: