forked from len0rd/rockbox
grayscale.rock, jpeg.rock and video.rock now use default_event_handler_ex(). Adapted and enabled them for Ondio.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5264 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
0dc52d5c36
commit
9db31cf886
4 changed files with 113 additions and 56 deletions
|
@ -15,8 +15,11 @@ viewer.c
|
||||||
#endif /* #if CONFIG_KEYPAD != ONDIO_PAD */
|
#endif /* #if CONFIG_KEYPAD != ONDIO_PAD */
|
||||||
|
|
||||||
#ifdef HAVE_LCD_BITMAP /* recorder model only */
|
#ifdef HAVE_LCD_BITMAP /* recorder model only */
|
||||||
|
grayscale.c
|
||||||
|
jpeg.c
|
||||||
rockblox.c
|
rockblox.c
|
||||||
snow.c
|
snow.c
|
||||||
|
video.c
|
||||||
#if CONFIG_KEYPAD != ONDIO_PAD
|
#if CONFIG_KEYPAD != ONDIO_PAD
|
||||||
/* gradually bring in the ones not working yet */
|
/* gradually bring in the ones not working yet */
|
||||||
bounce.c
|
bounce.c
|
||||||
|
@ -26,8 +29,6 @@ chip8.c
|
||||||
clock.c
|
clock.c
|
||||||
cube.c
|
cube.c
|
||||||
flipit.c
|
flipit.c
|
||||||
grayscale.c
|
|
||||||
jpeg.c
|
|
||||||
mandelbrot.c
|
mandelbrot.c
|
||||||
minesweeper.c
|
minesweeper.c
|
||||||
mosaique.c
|
mosaique.c
|
||||||
|
@ -40,7 +41,6 @@ sokoban.c
|
||||||
solitaire.c
|
solitaire.c
|
||||||
splitedit.c
|
splitedit.c
|
||||||
star.c
|
star.c
|
||||||
video.c
|
|
||||||
vu_meter.c
|
vu_meter.c
|
||||||
wormlet.c
|
wormlet.c
|
||||||
#endif /* #if CONFIG_KEYPAD != ONDIO_PAD */
|
#endif /* #if CONFIG_KEYPAD != ONDIO_PAD */
|
||||||
|
|
|
@ -25,6 +25,12 @@
|
||||||
#ifdef HAVE_LCD_BITMAP /* and also not for the Player */
|
#ifdef HAVE_LCD_BITMAP /* and also not for the Player */
|
||||||
#include "gray.h"
|
#include "gray.h"
|
||||||
|
|
||||||
|
/* variable button definitions */
|
||||||
|
#if CONFIG_KEYPAD == RECORDER_PAD
|
||||||
|
#define GRAYSCALE_SHIFT BUTTON_ON
|
||||||
|
#elif CONFIG_KEYPAD == ONDIO_PAD
|
||||||
|
#define GRAYSCALE_SHIFT BUTTON_MENU
|
||||||
|
#endif
|
||||||
/******************************* Globals ***********************************/
|
/******************************* Globals ***********************************/
|
||||||
|
|
||||||
static struct plugin_api* rb; /* global api struct pointer */
|
static struct plugin_api* rb; /* global api struct pointer */
|
||||||
|
@ -34,6 +40,15 @@ static unsigned int gbuf_size = 0;
|
||||||
|
|
||||||
/**************************** main function ********************************/
|
/**************************** main function ********************************/
|
||||||
|
|
||||||
|
void cleanup(void *parameter)
|
||||||
|
{
|
||||||
|
(void)parameter;
|
||||||
|
|
||||||
|
gray_release_buffer(); /* switch off overlay and deinitialize */
|
||||||
|
/* restore normal backlight setting */
|
||||||
|
rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
|
||||||
|
}
|
||||||
|
|
||||||
/* this is only a demo of what the framework can do */
|
/* this is only a demo of what the framework can do */
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
@ -193,21 +208,17 @@ int main(void)
|
||||||
|
|
||||||
button = rb->button_get(true);
|
button = rb->button_get(true);
|
||||||
|
|
||||||
if (button == SYS_USB_CONNECTED)
|
if (rb->default_event_handler_ex(button, cleanup, NULL)
|
||||||
{
|
== SYS_USB_CONNECTED)
|
||||||
gray_release_buffer(); /* switch off overlay and deinitialize */
|
|
||||||
/* restore normal backlight setting */
|
|
||||||
rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
|
|
||||||
return PLUGIN_USB_CONNECTED;
|
return PLUGIN_USB_CONNECTED;
|
||||||
}
|
|
||||||
|
|
||||||
if (button & BUTTON_ON)
|
if (button & GRAYSCALE_SHIFT)
|
||||||
black_border = true;
|
black_border = true;
|
||||||
|
|
||||||
if (button & BUTTON_REPEAT)
|
if (button & BUTTON_REPEAT)
|
||||||
scroll_amount = 4;
|
scroll_amount = 4;
|
||||||
|
|
||||||
switch(button & ~(BUTTON_ON | BUTTON_REPEAT))
|
switch(button & ~(GRAYSCALE_SHIFT | BUTTON_REPEAT))
|
||||||
{
|
{
|
||||||
case BUTTON_LEFT:
|
case BUTTON_LEFT:
|
||||||
|
|
||||||
|
@ -231,9 +242,7 @@ int main(void)
|
||||||
|
|
||||||
case BUTTON_OFF:
|
case BUTTON_OFF:
|
||||||
|
|
||||||
gray_release_buffer(); /* switch off overlay and deinitialize */
|
cleanup(NULL);
|
||||||
/* restore normal backlight setting */
|
|
||||||
rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
|
|
||||||
return PLUGIN_OK;
|
return PLUGIN_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -243,7 +252,6 @@ int main(void)
|
||||||
|
|
||||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
/* this macro should be called as the first thing you do in the plugin.
|
/* this macro should be called as the first thing you do in the plugin.
|
||||||
it test that the api version and model the plugin was compiled for
|
it test that the api version and model the plugin was compiled for
|
||||||
matches the machine it is running on */
|
matches the machine it is running on */
|
||||||
|
@ -255,11 +263,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
/* This plugin uses the grayscale framework, so initialize */
|
/* This plugin uses the grayscale framework, so initialize */
|
||||||
gray_init(api);
|
gray_init(api);
|
||||||
|
|
||||||
ret = main();
|
return main();
|
||||||
|
|
||||||
if (ret == PLUGIN_USB_CONNECTED)
|
|
||||||
rb->usb_screen();
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // #ifdef HAVE_LCD_BITMAP
|
#endif // #ifdef HAVE_LCD_BITMAP
|
||||||
|
|
|
@ -29,6 +29,16 @@
|
||||||
#ifdef HAVE_LCD_BITMAP /* and also not for the Player */
|
#ifdef HAVE_LCD_BITMAP /* and also not for the Player */
|
||||||
#include "gray.h"
|
#include "gray.h"
|
||||||
|
|
||||||
|
/* variable button definitions */
|
||||||
|
#if CONFIG_KEYPAD == RECORDER_PAD
|
||||||
|
#define JPEG_ZOOM_IN BUTTON_PLAY
|
||||||
|
#define JPEG_ZOOM_OUT BUTTON_ON
|
||||||
|
#elif CONFIG_KEYPAD == ONDIO_PAD
|
||||||
|
#define JPEG_ZOOM_PRE BUTTON_MENU
|
||||||
|
#define JPEG_ZOOM_IN (BUTTON_MENU | BUTTON_REL)
|
||||||
|
#define JPEG_ZOOM_OUT (BUTTON_MENU | BUTTON_REPEAT)
|
||||||
|
#endif
|
||||||
|
|
||||||
/******************************* Globals ***********************************/
|
/******************************* Globals ***********************************/
|
||||||
|
|
||||||
static struct plugin_api* rb;
|
static struct plugin_api* rb;
|
||||||
|
@ -1494,9 +1504,19 @@ int root_size;
|
||||||
#define ZOOM_IN 100 // return codes for below function
|
#define ZOOM_IN 100 // return codes for below function
|
||||||
#define ZOOM_OUT 101
|
#define ZOOM_OUT 101
|
||||||
|
|
||||||
|
/* switch off overlay, for handling SYS_ events */
|
||||||
|
void cleanup(void *parameter)
|
||||||
|
{
|
||||||
|
(void)parameter;
|
||||||
|
|
||||||
|
gray_show_display(false);
|
||||||
|
}
|
||||||
|
|
||||||
/* interactively scroll around the image */
|
/* interactively scroll around the image */
|
||||||
int scroll_bmp(struct t_disp* pdisp)
|
int scroll_bmp(struct t_disp* pdisp)
|
||||||
{
|
{
|
||||||
|
int lastbutton = 0;
|
||||||
|
|
||||||
/*empty the button queue first, to avoid unwanted scrolling */
|
/*empty the button queue first, to avoid unwanted scrolling */
|
||||||
while(rb->button_get(false) != BUTTON_NONE);
|
while(rb->button_get(false) != BUTTON_NONE);
|
||||||
|
|
||||||
|
@ -1506,13 +1526,15 @@ int scroll_bmp(struct t_disp* pdisp)
|
||||||
int move;
|
int move;
|
||||||
|
|
||||||
button = rb->button_get(true);
|
button = rb->button_get(true);
|
||||||
|
|
||||||
if (button == SYS_USB_CONNECTED)
|
if (rb->default_event_handler_ex(button, cleanup, NULL)
|
||||||
|
== SYS_USB_CONNECTED)
|
||||||
return PLUGIN_USB_CONNECTED;
|
return PLUGIN_USB_CONNECTED;
|
||||||
|
|
||||||
switch(button & ~(BUTTON_REPEAT))
|
switch(button)
|
||||||
{
|
{
|
||||||
case BUTTON_LEFT:
|
case BUTTON_LEFT:
|
||||||
|
case BUTTON_LEFT | BUTTON_REPEAT:
|
||||||
move = MIN(10, pdisp->x);
|
move = MIN(10, pdisp->x);
|
||||||
if (move > 0)
|
if (move > 0)
|
||||||
{
|
{
|
||||||
|
@ -1527,6 +1549,7 @@ int scroll_bmp(struct t_disp* pdisp)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BUTTON_RIGHT:
|
case BUTTON_RIGHT:
|
||||||
|
case BUTTON_RIGHT | BUTTON_REPEAT:
|
||||||
move = MIN(10, pdisp->width - pdisp->x - LCD_WIDTH);
|
move = MIN(10, pdisp->width - pdisp->x - LCD_WIDTH);
|
||||||
if (move > 0)
|
if (move > 0)
|
||||||
{
|
{
|
||||||
|
@ -1541,6 +1564,7 @@ int scroll_bmp(struct t_disp* pdisp)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BUTTON_UP:
|
case BUTTON_UP:
|
||||||
|
case BUTTON_UP | BUTTON_REPEAT:
|
||||||
move = MIN(8, pdisp->y);
|
move = MIN(8, pdisp->y);
|
||||||
if (move > 0)
|
if (move > 0)
|
||||||
{
|
{
|
||||||
|
@ -1558,6 +1582,7 @@ int scroll_bmp(struct t_disp* pdisp)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BUTTON_DOWN:
|
case BUTTON_DOWN:
|
||||||
|
case BUTTON_DOWN | BUTTON_REPEAT:
|
||||||
move = MIN(8, pdisp->height - pdisp->y - LCD_HEIGHT);
|
move = MIN(8, pdisp->height - pdisp->y - LCD_HEIGHT);
|
||||||
if (move > 0)
|
if (move > 0)
|
||||||
{
|
{
|
||||||
|
@ -1574,17 +1599,28 @@ int scroll_bmp(struct t_disp* pdisp)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BUTTON_PLAY:
|
case JPEG_ZOOM_IN:
|
||||||
|
#ifdef JPEG_ZOOM_PRE
|
||||||
|
if (lastbutton != JPEG_ZOOM_PRE)
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
return ZOOM_IN;
|
return ZOOM_IN;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BUTTON_ON:
|
case JPEG_ZOOM_OUT:
|
||||||
|
#ifdef JPEG_ZOOM_PRE
|
||||||
|
if (lastbutton != JPEG_ZOOM_PRE)
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
return ZOOM_OUT;
|
return ZOOM_OUT;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BUTTON_OFF:
|
case BUTTON_OFF:
|
||||||
return PLUGIN_OK;
|
return PLUGIN_OK;
|
||||||
} /* switch */
|
} /* switch */
|
||||||
|
|
||||||
|
if (button != BUTTON_NONE)
|
||||||
|
lastbutton = button;
|
||||||
} /* while (true) */
|
} /* while (true) */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1913,7 +1949,6 @@ int main(char* filename)
|
||||||
|
|
||||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
/* this macro should be called as the first thing you do in the plugin.
|
/* this macro should be called as the first thing you do in the plugin.
|
||||||
it test that the api version and model the plugin was compiled for
|
it test that the api version and model the plugin was compiled for
|
||||||
matches the machine it is running on */
|
matches the machine it is running on */
|
||||||
|
@ -1923,11 +1958,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
|
|
||||||
/* This plugin uses the grayscale framework, so initialize */
|
/* This plugin uses the grayscale framework, so initialize */
|
||||||
gray_init(api);
|
gray_init(api);
|
||||||
ret = main((char*)parameter);
|
|
||||||
|
|
||||||
if (ret == PLUGIN_USB_CONNECTED)
|
return main((char*)parameter);
|
||||||
rb->usb_screen();
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* #ifdef HAVE_LCD_BITMAP */
|
#endif /* #ifdef HAVE_LCD_BITMAP */
|
||||||
|
|
|
@ -32,6 +32,14 @@
|
||||||
#ifndef SIMULATOR // not for simulator by now
|
#ifndef SIMULATOR // not for simulator by now
|
||||||
#ifdef HAVE_LCD_BITMAP // and definitely not for the Player, haha
|
#ifdef HAVE_LCD_BITMAP // and definitely not for the Player, haha
|
||||||
|
|
||||||
|
/* variable button definitions */
|
||||||
|
#if CONFIG_KEYPAD == RECORDER_PAD
|
||||||
|
#define VIDEO_STOP_SEEK BUTTON_PLAY
|
||||||
|
#define VIDEO_RESUME BUTTON_PLAY
|
||||||
|
#elif CONFIG_KEYPAD == ONDIO_PAD
|
||||||
|
#define VIDEO_STOP_SEEK BUTTON_MENU
|
||||||
|
#define VIDEO_RESUME BUTTON_RIGHT
|
||||||
|
#endif
|
||||||
/****************** constants ******************/
|
/****************** constants ******************/
|
||||||
|
|
||||||
#define INT_MAX ((int)(~(unsigned)0 >> 1))
|
#define INT_MAX ((int)(~(unsigned)0 >> 1))
|
||||||
|
@ -274,6 +282,7 @@ void ChangeVolume(int delta)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if CONFIG_KEYPAD == RECORDER_PAD
|
||||||
// helper function to change the LCD contrast by a certain amount, +/-
|
// helper function to change the LCD contrast by a certain amount, +/-
|
||||||
void ChangeContrast(int delta)
|
void ChangeContrast(int delta)
|
||||||
{
|
{
|
||||||
|
@ -301,6 +310,7 @@ void ChangeContrast(int delta)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// sync the video to the current audio
|
// sync the video to the current audio
|
||||||
|
@ -440,6 +450,7 @@ int WaitForButton(void)
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
button = rb->button_get(true);
|
button = rb->button_get(true);
|
||||||
|
rb->default_event_handler(button);
|
||||||
} while ((button & BUTTON_REL) && button != SYS_USB_CONNECTED);
|
} while ((button & BUTTON_REL) && button != SYS_USB_CONNECTED);
|
||||||
|
|
||||||
return button;
|
return button;
|
||||||
|
@ -459,7 +470,7 @@ bool WantResume(int fd)
|
||||||
rb->lcd_update();
|
rb->lcd_update();
|
||||||
|
|
||||||
button = WaitForButton();
|
button = WaitForButton();
|
||||||
return (button == BUTTON_PLAY);
|
return (button == VIDEO_RESUME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -523,6 +534,23 @@ int SeekTo(int fd, int nPos)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// called from default_event_handler_ex() or at end of playback
|
||||||
|
void Cleanup(void *fd)
|
||||||
|
{
|
||||||
|
rb->close(*(int*)fd); // close the file
|
||||||
|
|
||||||
|
if (gPlay.bHasVideo)
|
||||||
|
rb->plugin_unregister_timer(); // stop video ISR, now I can use the display again
|
||||||
|
|
||||||
|
if (gPlay.bHasAudio)
|
||||||
|
rb->mp3_play_stop(); // stop audio ISR
|
||||||
|
|
||||||
|
// restore normal backlight setting
|
||||||
|
rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
|
||||||
|
|
||||||
|
// restore normal contrast
|
||||||
|
rb->lcd_set_contrast(rb->global_settings->contrast);
|
||||||
|
}
|
||||||
|
|
||||||
// returns >0 if continue, =0 to stop, <0 to abort (USB)
|
// returns >0 if continue, =0 to stop, <0 to abort (USB)
|
||||||
int PlayTick(int fd)
|
int PlayTick(int fd)
|
||||||
|
@ -631,6 +659,11 @@ int PlayTick(int fd)
|
||||||
filepos -= Available(gBuf.pReadVideo); // take video position
|
filepos -= Available(gBuf.pReadVideo); // take video position
|
||||||
else
|
else
|
||||||
filepos -= Available(gBuf.pReadAudio); // else audio
|
filepos -= Available(gBuf.pReadAudio); // else audio
|
||||||
|
|
||||||
|
if (rb->default_event_handler_ex(button, Cleanup, &fd)
|
||||||
|
== SYS_USB_CONNECTED)
|
||||||
|
retval = -1; // signal "aborted" to caller
|
||||||
|
// SYS_USB_CONNECTED won't be catched again by the switch()
|
||||||
|
|
||||||
switch (button)
|
switch (button)
|
||||||
{ // set exit conditions
|
{ // set exit conditions
|
||||||
|
@ -642,12 +675,10 @@ int PlayTick(int fd)
|
||||||
rb->lseek(fd, 0, SEEK_SET); // save resume position
|
rb->lseek(fd, 0, SEEK_SET); // save resume position
|
||||||
rb->write(fd, &gFileHdr, sizeof(gFileHdr));
|
rb->write(fd, &gFileHdr, sizeof(gFileHdr));
|
||||||
}
|
}
|
||||||
retval = 0; // signal "stop" to caller
|
Cleanup(&fd);
|
||||||
|
retval = 0; // signal "stopped" to caller
|
||||||
break;
|
break;
|
||||||
case SYS_USB_CONNECTED:
|
case VIDEO_STOP_SEEK:
|
||||||
retval = -1; // signal "abort" to caller
|
|
||||||
break;
|
|
||||||
case BUTTON_PLAY:
|
|
||||||
if (gPlay.bSeeking)
|
if (gPlay.bSeeking)
|
||||||
{
|
{
|
||||||
gPlay.bSeeking = false;
|
gPlay.bSeeking = false;
|
||||||
|
@ -714,6 +745,7 @@ int PlayTick(int fd)
|
||||||
else
|
else
|
||||||
gPlay.nSeekAcc++;
|
gPlay.nSeekAcc++;
|
||||||
break;
|
break;
|
||||||
|
#if CONFIG_KEYPAD == RECORDER_PAD
|
||||||
case BUTTON_F1: // debug key
|
case BUTTON_F1: // debug key
|
||||||
case BUTTON_F1 | BUTTON_REPEAT:
|
case BUTTON_F1 | BUTTON_REPEAT:
|
||||||
DrawBuf(); // show buffer status
|
DrawBuf(); // show buffer status
|
||||||
|
@ -730,6 +762,7 @@ int PlayTick(int fd)
|
||||||
if (gPlay.bHasVideo)
|
if (gPlay.bHasVideo)
|
||||||
ChangeContrast(1);
|
ChangeContrast(1);
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
} /* if (button != BUTTON_NONE) */
|
} /* if (button != BUTTON_NONE) */
|
||||||
|
|
||||||
|
@ -832,7 +865,13 @@ int main(char* filename)
|
||||||
gFileHdr.video_frametime = FREQ / FPS;
|
gFileHdr.video_frametime = FREQ / FPS;
|
||||||
gFileHdr.bps_peak = gFileHdr.bps_average = LCD_WIDTH * LCD_HEIGHT * FPS;
|
gFileHdr.bps_peak = gFileHdr.bps_average = LCD_WIDTH * LCD_HEIGHT * FPS;
|
||||||
}
|
}
|
||||||
|
#if FREQ == 12000000
|
||||||
|
/* temporary sync fix for Ondio, as .rvf is tailored to the recorder CPU freq
|
||||||
|
* 625 / 576 == 12000000 / 11059200 */
|
||||||
|
else
|
||||||
|
gFileHdr.video_frametime = (gFileHdr.video_frametime * 625) / 576;
|
||||||
|
#endif
|
||||||
|
|
||||||
// continue buffer init: align the end, calc low water, read sizes
|
// continue buffer init: align the end, calc low water, read sizes
|
||||||
gBuf.granularity = gFileHdr.blocksize;
|
gBuf.granularity = gFileHdr.blocksize;
|
||||||
while (gBuf.granularity % 512) // common multiple of sector size
|
while (gBuf.granularity % 512) // common multiple of sector size
|
||||||
|
@ -877,20 +916,6 @@ int main(char* filename)
|
||||||
retval = PlayTick(fd);
|
retval = PlayTick(fd);
|
||||||
} while (retval > 0);
|
} while (retval > 0);
|
||||||
|
|
||||||
rb->close(fd); // close the file
|
|
||||||
|
|
||||||
if (gPlay.bHasVideo)
|
|
||||||
rb->plugin_unregister_timer(); // stop video ISR, now I can use the display again
|
|
||||||
|
|
||||||
if (gPlay.bHasAudio)
|
|
||||||
rb->mp3_play_stop(); // stop audio ISR
|
|
||||||
|
|
||||||
// restore normal backlight setting
|
|
||||||
rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
|
|
||||||
|
|
||||||
// restore normal contrast
|
|
||||||
rb->lcd_set_contrast(rb->global_settings->contrast);
|
|
||||||
|
|
||||||
if (retval < 0) // aborted?
|
if (retval < 0) // aborted?
|
||||||
{
|
{
|
||||||
return PLUGIN_USB_CONNECTED;
|
return PLUGIN_USB_CONNECTED;
|
||||||
|
@ -930,7 +955,6 @@ int main(char* filename)
|
||||||
|
|
||||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
/* this macro should be called as the first thing you do in the plugin.
|
/* this macro should be called as the first thing you do in the plugin.
|
||||||
it test that the api version and model the plugin was compiled for
|
it test that the api version and model the plugin was compiled for
|
||||||
matches the machine it is running on */
|
matches the machine it is running on */
|
||||||
|
@ -945,10 +969,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
}
|
}
|
||||||
|
|
||||||
// now go ahead and have fun!
|
// now go ahead and have fun!
|
||||||
ret = main((char*) parameter);
|
return main((char*) parameter);
|
||||||
if (ret==PLUGIN_USB_CONNECTED)
|
|
||||||
rb->usb_screen();
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // #ifdef HAVE_LCD_BITMAP
|
#endif // #ifdef HAVE_LCD_BITMAP
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue