summaryrefslogtreecommitdiff
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
99stats,apps 99stats,apps
100stopwatch,apps 100stopwatch,apps
101sudoku,games 101sudoku,games
102test_boost,apps
102test_codec,viewers 103test_codec,viewers
103test_disk,apps 104test_disk,apps
104test_fps,apps 105test_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)
29 bool done = false; 29 bool done = false;
30 bool boost = false; 30 bool boost = false;
31 int count = 0; 31 int count = 0;
32 int last_count = 0;
33 int last_tick = *rb->current_tick;
34 int per_sec = 0;
32 35
33 rb->lcd_setfont(FONT_SYSFIXED); 36 rb->lcd_setfont(FONT_SYSFIXED);
34 37
35 while (!done) 38 while (!done)
36 { 39 {
37 char buf[32];
38 int j,x; 40 int j,x;
39 for (j=1; j<100000; j++) 41 for (j=1; j<100000; j++)
40 x = j*11; 42 x = j*11;
41 rb->lcd_clear_display(); 43 rb->screens[0]->clear_display();
42 rb->snprintf(buf,sizeof buf, "%s %d",boost?"boost":"normal",count); 44 rb->screens[0]->putsf(0, 0, "%s: %d",boost?"boost":"normal",count);
43 rb->lcd_putsxy(0, 0, buf); 45 if (TIME_AFTER(*rb->current_tick, last_tick+HZ))
44 rb->lcd_update(); 46 {
47 last_tick = *rb->current_tick;
48 per_sec = count-last_count;
49 last_count = count;
50 }
51 rb->screens[0]->putsf(0, 1, "loops/s: %d", per_sec);
52 rb->screens[0]->update();
45 count++; 53 count++;
46 54
47 int button = rb->button_get(false); 55 int button = rb->button_get(false);
48 switch (button) 56 switch (button)
49 { 57 {
50 case BUTTON_UP: 58 case BUTTON_UP:
51 boost = true; 59 if (!boost)
52 rb->cpu_boost(boost); 60 {
61 rb->cpu_boost(true);
62 boost = true;
63 }
53 break; 64 break;
54 65
55 case BUTTON_DOWN: 66 case BUTTON_DOWN:
56 boost = false; 67 if (boost)
57 rb->cpu_boost(boost); 68 {
69 rb->cpu_boost(false);
70 boost = false;
71 }
58 break; 72 break;
59 73
60 case BUTTON_LEFT: 74 case BUTTON_LEFT: