1
0
Fork 0
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:
Jörg Hohensohn 2004-10-22 20:21:00 +00:00
parent 705ad51035
commit 27f68f1d24
2 changed files with 24 additions and 63 deletions

View file

@ -80,12 +80,12 @@
#ifdef PLATFORM_ID
#if CONFIG_KEYPAD == ONDIO_PAD /* limited keypad */
#define KEY1 BUTTON_UP
#define KEY2 BUTTON_RIGHT
#define KEY3 BUTTON_DOWN
#define KEYNAME1 "[UP]"
#define KEYNAME2 "[RIGHT]"
#define KEYNAME3 "[DOWN]"
#define KEY1 BUTTON_LEFT
#define KEY2 BUTTON_UP
#define KEY3 BUTTON_RIGHT
#define KEYNAME1 "[Left]"
#define KEYNAME2 "[Up]"
#define KEYNAME3 "[Right]"
#else /* recorder keypad */
#define KEY1 BUTTON_F1
#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);
}
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
|| platform_id == ID_REC_V2);
}
else if (version == 104)
{ /* classic Ondio128 */
return (platform_id == ID_ONDIO_FM);
}
else if (version >= 115 && version <= 129)
{ /* the range of Recorders seen so far */
return (platform_id == ID_RECORDER);

View file

@ -8,7 +8,7 @@
* $Id$
*
* 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
*
@ -46,21 +46,18 @@ static volatile UINT8* FB = (UINT8*)0x02000000; /* Flash base address */
#define ROCKBOX_DEST 0x09000000
#define ROCKBOX_EXEC 0x09000200
#define DEFAULT_FILENAME "/rockbox.ucl"
#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 UCL_HEADER 26 /* size of the header generated by uclpack */
#if CONFIG_KEYPAD == ONDIO_PAD /* limited keypad */
#define KEY1 BUTTON_UP
#define KEY2 BUTTON_RIGHT
#define KEY3 BUTTON_DOWN
#define KEYNAME1 "UP"
#define KEYNAME2 "RIGHT"
#define KEY1 BUTTON_LEFT
#define KEY2 BUTTON_UP
#define KEYNAME1 "[Left]"
#define KEYNAME2 "[Up]"
#else /* recorder keypad */
#define KEY1 BUTTON_F1
#define KEY2 BUTTON_F2
#define KEY3 BUTTON_F3
#define KEYNAME1 "F1"
#define KEYNAME2 "F2"
#endif
@ -615,7 +612,7 @@ void ShowFlashInfo(tFlashInfo* pInfo, tImageHeader* pImageHeader)
/* Kind of our main function, defines the application flow. */
#ifdef HAVE_LCD_BITMAP
/* recorder version */
void DoUserDialog(char* filename, bool show_greet)
void DoUserDialog(char* filename)
{
tImageHeader ImageHeader;
tFlashInfo FlashInfo;
@ -626,6 +623,7 @@ void DoUserDialog(char* filename, bool show_greet)
UINT8* pos;
int memleft;
UINT32 crc;
bool show_greet = false;
rb->lcd_setfont(FONT_SYSFIXED);
@ -682,21 +680,6 @@ void DoUserDialog(char* filename, bool show_greet)
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_update();
@ -822,7 +805,7 @@ void DoUserDialog(char* filename, bool show_greet)
#else /* #ifdef HAVE_LCD_BITMAP */
/* Player version */
void DoUserDialog(char* filename, bool show_greet)
void DoUserDialog(char* filename)
{
tImageHeader ImageHeader;
tFlashInfo FlashInfo;
@ -833,6 +816,7 @@ void DoUserDialog(char* filename, bool show_greet)
UINT8* pos;
int memleft;
UINT32 crc;
bool show_greet = false;
/* this can only work if Rockbox runs in DRAM, not flash ROM */
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();
rc = GetFlashInfo(&FlashInfo);
if (show_greet)
{
ShowFlashInfo(&FlashInfo, (void*)pos);
WaitForButton();
}
if (FlashInfo.size == 0) /* no valid chip */
{
rb->splash(HZ*3, true, "Not flashable");
@ -882,19 +860,6 @@ void DoUserDialog(char* filename, bool show_greet)
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...");
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)
{
char* filename;
bool show_greet;
int oldmode;
/* 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
matches the machine it is running on */
TEST_PLUGIN_API(api);
rb = api; /* copy to global api pointer */
if (parameter == NULL)
{
filename = DEFAULT_FILENAME;
show_greet = true;
rb->splash(HZ*3, true, "Play .ucl file!");
return PLUGIN_OK;
}
else
{
filename = (char*) parameter;
show_greet = false;
}
rb = api; /* copy to global api pointer */
/* now go ahead and have fun! */
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 */
return PLUGIN_OK;