forked from len0rd/rockbox
allow Ondio ROM v1.04 for flashing, I changed my mind about the Ondio key assignment, some cleanup
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5323 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
705ad51035
commit
27f68f1d24
2 changed files with 24 additions and 63 deletions
|
@ -80,12 +80,12 @@
|
||||||
#ifdef PLATFORM_ID
|
#ifdef PLATFORM_ID
|
||||||
|
|
||||||
#if CONFIG_KEYPAD == ONDIO_PAD /* limited keypad */
|
#if CONFIG_KEYPAD == ONDIO_PAD /* limited keypad */
|
||||||
#define KEY1 BUTTON_UP
|
#define KEY1 BUTTON_LEFT
|
||||||
#define KEY2 BUTTON_RIGHT
|
#define KEY2 BUTTON_UP
|
||||||
#define KEY3 BUTTON_DOWN
|
#define KEY3 BUTTON_RIGHT
|
||||||
#define KEYNAME1 "[UP]"
|
#define KEYNAME1 "[Left]"
|
||||||
#define KEYNAME2 "[RIGHT]"
|
#define KEYNAME2 "[Up]"
|
||||||
#define KEYNAME3 "[DOWN]"
|
#define KEYNAME3 "[Right]"
|
||||||
#else /* recorder keypad */
|
#else /* recorder keypad */
|
||||||
#define KEY1 BUTTON_F1
|
#define KEY1 BUTTON_F1
|
||||||
#define KEY2 BUTTON_F2
|
#define KEY2 BUTTON_F2
|
||||||
|
@ -310,10 +310,14 @@ bool CheckPlatform(int platform_id, UINT16 version)
|
||||||
return (platform_id == ID_FM || platform_id == ID_REC_V2);
|
return (platform_id == ID_FM || platform_id == ID_REC_V2);
|
||||||
}
|
}
|
||||||
else if (version == 132)
|
else if (version == 132)
|
||||||
{ /* Ondio, and seen on a V2 recorder */
|
{ /* newer Ondio, and seen on a V2 recorder */
|
||||||
return (platform_id == ID_ONDIO_SP || platform_id == ID_ONDIO_FM
|
return (platform_id == ID_ONDIO_SP || platform_id == ID_ONDIO_FM
|
||||||
|| platform_id == ID_REC_V2);
|
|| platform_id == ID_REC_V2);
|
||||||
}
|
}
|
||||||
|
else if (version == 104)
|
||||||
|
{ /* classic Ondio128 */
|
||||||
|
return (platform_id == ID_ONDIO_FM);
|
||||||
|
}
|
||||||
else if (version >= 115 && version <= 129)
|
else if (version >= 115 && version <= 129)
|
||||||
{ /* the range of Recorders seen so far */
|
{ /* the range of Recorders seen so far */
|
||||||
return (platform_id == ID_RECORDER);
|
return (platform_id == ID_RECORDER);
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
* $Id$
|
* $Id$
|
||||||
*
|
*
|
||||||
* Plugin for reprogramming only the second image in Flash ROM.
|
* Plugin for reprogramming only the second image in Flash ROM.
|
||||||
* !!! DON'T MESS WITH THIS CODE UNLESS YOU'RE ABSOLUTELY SHURE WHAT YOU DO !!!
|
* !!! DON'T MESS WITH THIS CODE UNLESS YOU'RE ABSOLUTELY SURE WHAT YOU DO !!!
|
||||||
*
|
*
|
||||||
* Copyright (C) 2003 Jörg Hohensohn aka [IDC]Dragon
|
* Copyright (C) 2003 Jörg Hohensohn aka [IDC]Dragon
|
||||||
*
|
*
|
||||||
|
@ -46,21 +46,18 @@ static volatile UINT8* FB = (UINT8*)0x02000000; /* Flash base address */
|
||||||
|
|
||||||
#define ROCKBOX_DEST 0x09000000
|
#define ROCKBOX_DEST 0x09000000
|
||||||
#define ROCKBOX_EXEC 0x09000200
|
#define ROCKBOX_EXEC 0x09000200
|
||||||
#define DEFAULT_FILENAME "/rockbox.ucl"
|
|
||||||
#define BOOT_VERS_ADR 0xFA /* position of bootloader version value in Flash */
|
#define BOOT_VERS_ADR 0xFA /* position of bootloader version value in Flash */
|
||||||
#define FW_VERS_ADR 0xFE /* position of firmware version value in Flash */
|
#define FW_VERS_ADR 0xFE /* position of firmware version value in Flash */
|
||||||
#define UCL_HEADER 26 /* size of the header generated by uclpack */
|
#define UCL_HEADER 26 /* size of the header generated by uclpack */
|
||||||
|
|
||||||
#if CONFIG_KEYPAD == ONDIO_PAD /* limited keypad */
|
#if CONFIG_KEYPAD == ONDIO_PAD /* limited keypad */
|
||||||
#define KEY1 BUTTON_UP
|
#define KEY1 BUTTON_LEFT
|
||||||
#define KEY2 BUTTON_RIGHT
|
#define KEY2 BUTTON_UP
|
||||||
#define KEY3 BUTTON_DOWN
|
#define KEYNAME1 "[Left]"
|
||||||
#define KEYNAME1 "UP"
|
#define KEYNAME2 "[Up]"
|
||||||
#define KEYNAME2 "RIGHT"
|
|
||||||
#else /* recorder keypad */
|
#else /* recorder keypad */
|
||||||
#define KEY1 BUTTON_F1
|
#define KEY1 BUTTON_F1
|
||||||
#define KEY2 BUTTON_F2
|
#define KEY2 BUTTON_F2
|
||||||
#define KEY3 BUTTON_F3
|
|
||||||
#define KEYNAME1 "F1"
|
#define KEYNAME1 "F1"
|
||||||
#define KEYNAME2 "F2"
|
#define KEYNAME2 "F2"
|
||||||
#endif
|
#endif
|
||||||
|
@ -615,7 +612,7 @@ void ShowFlashInfo(tFlashInfo* pInfo, tImageHeader* pImageHeader)
|
||||||
/* Kind of our main function, defines the application flow. */
|
/* Kind of our main function, defines the application flow. */
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
/* recorder version */
|
/* recorder version */
|
||||||
void DoUserDialog(char* filename, bool show_greet)
|
void DoUserDialog(char* filename)
|
||||||
{
|
{
|
||||||
tImageHeader ImageHeader;
|
tImageHeader ImageHeader;
|
||||||
tFlashInfo FlashInfo;
|
tFlashInfo FlashInfo;
|
||||||
|
@ -626,6 +623,7 @@ void DoUserDialog(char* filename, bool show_greet)
|
||||||
UINT8* pos;
|
UINT8* pos;
|
||||||
int memleft;
|
int memleft;
|
||||||
UINT32 crc;
|
UINT32 crc;
|
||||||
|
bool show_greet = false;
|
||||||
|
|
||||||
rb->lcd_setfont(FONT_SYSFIXED);
|
rb->lcd_setfont(FONT_SYSFIXED);
|
||||||
|
|
||||||
|
@ -682,21 +680,6 @@ void DoUserDialog(char* filename, bool show_greet)
|
||||||
rb->lcd_clear_display();
|
rb->lcd_clear_display();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (show_greet)
|
|
||||||
{
|
|
||||||
rb->lcd_puts(0, 3, "using file:");
|
|
||||||
rb->lcd_puts_scroll(0, 4, filename);
|
|
||||||
rb->lcd_puts(0, 6, "[" KEYNAME1 "] to check file");
|
|
||||||
rb->lcd_puts(0, 7, "other key to exit");
|
|
||||||
rb->lcd_update();
|
|
||||||
|
|
||||||
if (WaitForButton() != KEY1)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
rb->lcd_clear_display();
|
|
||||||
}
|
|
||||||
|
|
||||||
rb->lcd_puts(0, show_greet ? 0 : 3, "Checking...");
|
rb->lcd_puts(0, show_greet ? 0 : 3, "Checking...");
|
||||||
rb->lcd_update();
|
rb->lcd_update();
|
||||||
|
|
||||||
|
@ -822,7 +805,7 @@ void DoUserDialog(char* filename, bool show_greet)
|
||||||
#else /* #ifdef HAVE_LCD_BITMAP */
|
#else /* #ifdef HAVE_LCD_BITMAP */
|
||||||
|
|
||||||
/* Player version */
|
/* Player version */
|
||||||
void DoUserDialog(char* filename, bool show_greet)
|
void DoUserDialog(char* filename)
|
||||||
{
|
{
|
||||||
tImageHeader ImageHeader;
|
tImageHeader ImageHeader;
|
||||||
tFlashInfo FlashInfo;
|
tFlashInfo FlashInfo;
|
||||||
|
@ -833,6 +816,7 @@ void DoUserDialog(char* filename, bool show_greet)
|
||||||
UINT8* pos;
|
UINT8* pos;
|
||||||
int memleft;
|
int memleft;
|
||||||
UINT32 crc;
|
UINT32 crc;
|
||||||
|
bool show_greet = false;
|
||||||
|
|
||||||
/* this can only work if Rockbox runs in DRAM, not flash ROM */
|
/* this can only work if Rockbox runs in DRAM, not flash ROM */
|
||||||
if ((UINT8*)rb >= FB && (UINT8*)rb < FB + 4096*1024) /* 4 MB max */
|
if ((UINT8*)rb >= FB && (UINT8*)rb < FB + 4096*1024) /* 4 MB max */
|
||||||
|
@ -852,12 +836,6 @@ void DoUserDialog(char* filename, bool show_greet)
|
||||||
pos = (void*)GetSecondImage();
|
pos = (void*)GetSecondImage();
|
||||||
rc = GetFlashInfo(&FlashInfo);
|
rc = GetFlashInfo(&FlashInfo);
|
||||||
|
|
||||||
if (show_greet)
|
|
||||||
{
|
|
||||||
ShowFlashInfo(&FlashInfo, (void*)pos);
|
|
||||||
WaitForButton();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (FlashInfo.size == 0) /* no valid chip */
|
if (FlashInfo.size == 0) /* no valid chip */
|
||||||
{
|
{
|
||||||
rb->splash(HZ*3, true, "Not flashable");
|
rb->splash(HZ*3, true, "Not flashable");
|
||||||
|
@ -882,19 +860,6 @@ void DoUserDialog(char* filename, bool show_greet)
|
||||||
rb->lcd_clear_display();
|
rb->lcd_clear_display();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (show_greet)
|
|
||||||
{
|
|
||||||
rb->snprintf(buf, sizeof(buf), "File: %s", filename);
|
|
||||||
rb->lcd_puts_scroll(0, 0, buf);
|
|
||||||
rb->lcd_puts_scroll(0, 1, "[Menu] to check file, other key to exit");
|
|
||||||
|
|
||||||
if (WaitForButton() != BUTTON_MENU)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
rb->lcd_clear_display();
|
|
||||||
}
|
|
||||||
|
|
||||||
rb->lcd_puts(0, 0, "Checking...");
|
rb->lcd_puts(0, 0, "Checking...");
|
||||||
|
|
||||||
space = FlashInfo.size - (pos-FB + sizeof(ImageHeader));
|
space = FlashInfo.size - (pos-FB + sizeof(ImageHeader));
|
||||||
|
@ -1001,31 +966,23 @@ void DoUserDialog(char* filename, bool show_greet)
|
||||||
|
|
||||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
{
|
{
|
||||||
char* filename;
|
|
||||||
bool show_greet;
|
|
||||||
int oldmode;
|
int oldmode;
|
||||||
|
|
||||||
/* 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 */
|
||||||
TEST_PLUGIN_API(api);
|
TEST_PLUGIN_API(api);
|
||||||
|
rb = api; /* copy to global api pointer */
|
||||||
|
|
||||||
if (parameter == NULL)
|
if (parameter == NULL)
|
||||||
{
|
{
|
||||||
filename = DEFAULT_FILENAME;
|
rb->splash(HZ*3, true, "Play .ucl file!");
|
||||||
show_greet = true;
|
return PLUGIN_OK;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
filename = (char*) parameter;
|
|
||||||
show_greet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
rb = api; /* copy to global api pointer */
|
|
||||||
|
|
||||||
/* now go ahead and have fun! */
|
/* now go ahead and have fun! */
|
||||||
oldmode = rb->system_memory_guard(MEMGUARD_NONE); /*disable memory guard */
|
oldmode = rb->system_memory_guard(MEMGUARD_NONE); /*disable memory guard */
|
||||||
DoUserDialog(filename, show_greet);
|
DoUserDialog((char*) parameter);
|
||||||
rb->system_memory_guard(oldmode); /* re-enable memory guard */
|
rb->system_memory_guard(oldmode); /* re-enable memory guard */
|
||||||
|
|
||||||
return PLUGIN_OK;
|
return PLUGIN_OK;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue