summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/plugins/oscillograph.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/apps/plugins/oscillograph.c b/apps/plugins/oscillograph.c
index 0728dc1b61..a8d3243444 100644
--- a/apps/plugins/oscillograph.c
+++ b/apps/plugins/oscillograph.c
@@ -19,7 +19,6 @@
19#include "plugin.h" 19#include "plugin.h"
20 20
21#ifdef HAVE_LCD_BITMAP 21#ifdef HAVE_LCD_BITMAP
22#ifndef SIMULATOR /* don't want this code in the simulator */
23 22
24PLUGIN_HEADER 23PLUGIN_HEADER
25 24
@@ -89,8 +88,10 @@ PLUGIN_HEADER
89static struct plugin_api* rb; 88static struct plugin_api* rb;
90/* number of ticks between two volume samples */ 89/* number of ticks between two volume samples */
91static int speed = 1; 90static int speed = 1;
91#ifndef SIMULATOR
92/* roll == true -> lcd rolls */ 92/* roll == true -> lcd rolls */
93static bool roll = true; 93static bool roll = true;
94#endif
94/* see DRAW_MODE_XXX constants for valid values */ 95/* see DRAW_MODE_XXX constants for valid values */
95static int drawMode = DRAW_MODE_FILLED; 96static int drawMode = DRAW_MODE_FILLED;
96 97
@@ -100,9 +101,11 @@ static int drawMode = DRAW_MODE_FILLED;
100void cleanup(void *parameter) 101void cleanup(void *parameter)
101{ 102{
102 (void)parameter; 103 (void)parameter;
104#ifndef SIMULATOR
103 /* restore to default roll position. 105 /* restore to default roll position.
104 Looks funny if you forget to do this... */ 106 Looks funny if you forget to do this... */
105 rb->lcd_roll(0); 107 rb->lcd_roll(0);
108#endif
106 rb->lcd_update(); 109 rb->lcd_update();
107} 110}
108 111
@@ -188,10 +191,12 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
188 if (y >= LCD_HEIGHT) 191 if (y >= LCD_HEIGHT)
189 y = 0; 192 y = 0;
190 193
194#ifndef SIMULATOR
191 /* I roll before update because otherwise the new 195 /* I roll before update because otherwise the new
192 line would appear at the wrong end of the display */ 196 line would appear at the wrong end of the display */
193 if (roll) 197 if (roll)
194 rb->lcd_roll(y); 198 rb->lcd_roll(y);
199#endif
195 200
196 /* now finally make the new sample visible */ 201 /* now finally make the new sample visible */
197 rb->lcd_update_rect(0, MAX(y-1, 0), LCD_WIDTH, 2); 202 rb->lcd_update_rect(0, MAX(y-1, 0), LCD_WIDTH, 2);
@@ -234,16 +239,19 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
234 break; 239 break;
235#endif 240#endif
236 241
242#ifndef SIMULATOR
237 case OSCILLOGRAPH_ROLL: 243 case OSCILLOGRAPH_ROLL:
238 /* toggle rolling */ 244 /* toggle rolling */
239 roll = !roll; 245 roll = !roll;
240 break; 246 break;
241 247#endif
248
242 case OSCILLOGRAPH_MODE: 249 case OSCILLOGRAPH_MODE:
243 /* step through the display modes */ 250 /* step through the display modes */
244 drawMode ++; 251 drawMode ++;
245 drawMode = drawMode % DRAW_MODE_COUNT; 252 drawMode = drawMode % DRAW_MODE_COUNT;
246 253
254#ifndef SIMULATOR
247 /* lcd buffer might be rolled so that 255 /* lcd buffer might be rolled so that
248 the transition from LCD_HEIGHT to 0 256 the transition from LCD_HEIGHT to 0
249 takes place in the middle of the screen. 257 takes place in the middle of the screen.
@@ -251,8 +259,9 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
251 mode. If rolling is enabled this change will 259 mode. If rolling is enabled this change will
252 be reverted before the next update anyway.*/ 260 be reverted before the next update anyway.*/
253 rb->lcd_roll(0); 261 rb->lcd_roll(0);
262#endif
254 break; 263 break;
255 264
256 case OSCILLOGRAPH_SPEED_RESET: 265 case OSCILLOGRAPH_SPEED_RESET:
257 speed = 1; 266 speed = 1;
258 draw = true; 267 draw = true;
@@ -284,5 +293,4 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
284 return PLUGIN_OK; 293 return PLUGIN_OK;
285} 294}
286 295
287#endif /* #ifndef SIMULATOR */
288#endif 296#endif