forked from len0rd/rockbox
Get oscillograph plugin working in the sim. Skips the lcd_roll using parts.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8918 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
31e92f8068
commit
3caf7a6b3f
1 changed files with 12 additions and 4 deletions
|
|
@ -19,7 +19,6 @@
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
#ifndef SIMULATOR /* don't want this code in the simulator */
|
|
||||||
|
|
||||||
PLUGIN_HEADER
|
PLUGIN_HEADER
|
||||||
|
|
||||||
|
|
@ -89,8 +88,10 @@ PLUGIN_HEADER
|
||||||
static struct plugin_api* rb;
|
static struct plugin_api* rb;
|
||||||
/* number of ticks between two volume samples */
|
/* number of ticks between two volume samples */
|
||||||
static int speed = 1;
|
static int speed = 1;
|
||||||
|
#ifndef SIMULATOR
|
||||||
/* roll == true -> lcd rolls */
|
/* roll == true -> lcd rolls */
|
||||||
static bool roll = true;
|
static bool roll = true;
|
||||||
|
#endif
|
||||||
/* see DRAW_MODE_XXX constants for valid values */
|
/* see DRAW_MODE_XXX constants for valid values */
|
||||||
static int drawMode = DRAW_MODE_FILLED;
|
static int drawMode = DRAW_MODE_FILLED;
|
||||||
|
|
||||||
|
|
@ -100,9 +101,11 @@ static int drawMode = DRAW_MODE_FILLED;
|
||||||
void cleanup(void *parameter)
|
void cleanup(void *parameter)
|
||||||
{
|
{
|
||||||
(void)parameter;
|
(void)parameter;
|
||||||
|
#ifndef SIMULATOR
|
||||||
/* restore to default roll position.
|
/* restore to default roll position.
|
||||||
Looks funny if you forget to do this... */
|
Looks funny if you forget to do this... */
|
||||||
rb->lcd_roll(0);
|
rb->lcd_roll(0);
|
||||||
|
#endif
|
||||||
rb->lcd_update();
|
rb->lcd_update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -188,10 +191,12 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
if (y >= LCD_HEIGHT)
|
if (y >= LCD_HEIGHT)
|
||||||
y = 0;
|
y = 0;
|
||||||
|
|
||||||
|
#ifndef SIMULATOR
|
||||||
/* I roll before update because otherwise the new
|
/* I roll before update because otherwise the new
|
||||||
line would appear at the wrong end of the display */
|
line would appear at the wrong end of the display */
|
||||||
if (roll)
|
if (roll)
|
||||||
rb->lcd_roll(y);
|
rb->lcd_roll(y);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* now finally make the new sample visible */
|
/* now finally make the new sample visible */
|
||||||
rb->lcd_update_rect(0, MAX(y-1, 0), LCD_WIDTH, 2);
|
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)
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef SIMULATOR
|
||||||
case OSCILLOGRAPH_ROLL:
|
case OSCILLOGRAPH_ROLL:
|
||||||
/* toggle rolling */
|
/* toggle rolling */
|
||||||
roll = !roll;
|
roll = !roll;
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case OSCILLOGRAPH_MODE:
|
case OSCILLOGRAPH_MODE:
|
||||||
/* step through the display modes */
|
/* step through the display modes */
|
||||||
drawMode ++;
|
drawMode ++;
|
||||||
drawMode = drawMode % DRAW_MODE_COUNT;
|
drawMode = drawMode % DRAW_MODE_COUNT;
|
||||||
|
|
||||||
|
#ifndef SIMULATOR
|
||||||
/* lcd buffer might be rolled so that
|
/* lcd buffer might be rolled so that
|
||||||
the transition from LCD_HEIGHT to 0
|
the transition from LCD_HEIGHT to 0
|
||||||
takes place in the middle of the screen.
|
takes place in the middle of the screen.
|
||||||
|
|
@ -251,8 +259,9 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
mode. If rolling is enabled this change will
|
mode. If rolling is enabled this change will
|
||||||
be reverted before the next update anyway.*/
|
be reverted before the next update anyway.*/
|
||||||
rb->lcd_roll(0);
|
rb->lcd_roll(0);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OSCILLOGRAPH_SPEED_RESET:
|
case OSCILLOGRAPH_SPEED_RESET:
|
||||||
speed = 1;
|
speed = 1;
|
||||||
draw = true;
|
draw = true;
|
||||||
|
|
@ -284,5 +293,4 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
return PLUGIN_OK;
|
return PLUGIN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* #ifndef SIMULATOR */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue