summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/plugins/CATEGORIES1
-rw-r--r--apps/plugins/test_boost.c32
2 files changed, 24 insertions, 9 deletions
diff --git a/apps/plugins/CATEGORIES b/apps/plugins/CATEGORIES
index f1e18832bc..f61ff9b69f 100644
--- a/apps/plugins/CATEGORIES
+++ b/apps/plugins/CATEGORIES
@@ -99,6 +99,7 @@ starfield,demos
stats,apps
stopwatch,apps
sudoku,games
+test_boost,apps
test_codec,viewers
test_disk,apps
test_fps,apps
diff --git a/apps/plugins/test_boost.c b/apps/plugins/test_boost.c
index 0cd2696e33..cd38932b1b 100644
--- a/apps/plugins/test_boost.c
+++ b/apps/plugins/test_boost.c
@@ -29,32 +29,46 @@ enum plugin_status plugin_start(const void* parameter)
bool done = false;
bool boost = false;
int count = 0;
+ int last_count = 0;
+ int last_tick = *rb->current_tick;
+ int per_sec = 0;
rb->lcd_setfont(FONT_SYSFIXED);
while (!done)
{
- char buf[32];
int j,x;
for (j=1; j<100000; j++)
x = j*11;
- rb->lcd_clear_display();
- rb->snprintf(buf,sizeof buf, "%s %d",boost?"boost":"normal",count);
- rb->lcd_putsxy(0, 0, buf);
- rb->lcd_update();
+ rb->screens[0]->clear_display();
+ rb->screens[0]->putsf(0, 0, "%s: %d",boost?"boost":"normal",count);
+ if (TIME_AFTER(*rb->current_tick, last_tick+HZ))
+ {
+ 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++;
int button = rb->button_get(false);
switch (button)
{
case BUTTON_UP:
- boost = true;
- rb->cpu_boost(boost);
+ if (!boost)
+ {
+ rb->cpu_boost(true);
+ boost = true;
+ }
break;
case BUTTON_DOWN:
- boost = false;
- rb->cpu_boost(boost);
+ if (boost)
+ {
+ rb->cpu_boost(false);
+ boost = false;
+ }
break;
case BUTTON_LEFT: