summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJörg Hohensohn <hohensoh@rockbox.org>2003-07-25 17:34:42 +0000
committerJörg Hohensohn <hohensoh@rockbox.org>2003-07-25 17:34:42 +0000
commit7d889c87df474e683ad69d063375c3c9286e36ec (patch)
treed701018246e81e9e31b67c2bec113172a9a6564f /apps
parentdf67fb2ea34a327fe79d1c0fc88cf0e2203aa949 (diff)
downloadrockbox-7d889c87df474e683ad69d063375c3c9286e36ec.tar.gz
rockbox-7d889c87df474e683ad69d063375c3c9286e36ec.zip
the plugin half of Lee Marlow's patch: second agument can be the filename of the .ucl to be flashed
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3887 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/rockbox_flash.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/apps/plugins/rockbox_flash.c b/apps/plugins/rockbox_flash.c
index 1fb8ce5bcc..67e0753503 100644
--- a/apps/plugins/rockbox_flash.c
+++ b/apps/plugins/rockbox_flash.c
@@ -41,7 +41,7 @@ static volatile UINT8* FB = (UINT8*)0x02000000; /* Flash base address */
#define ROCKBOX_DEST 0x09000000
#define ROCKBOX_EXEC 0x09000200
-#define FILENAME "/rockbox.ucl"
+#define DEFAULT_FILENAME "/rockbox.ucl"
#define VERS_ADR 0xFE /* position of firmware version value in Flash */
#define UCL_HEADER 26 /* size of the header generated by uclpack */
@@ -492,7 +492,7 @@ void ShowFlashInfo(tFlashInfo* pInfo, tImageHeader* pImageHeader)
/* Kind of our main function, defines the application flow. */
-void DoUserDialog(void)
+void DoUserDialog(char* filename)
{
tImageHeader ImageHeader;
tFlashInfo FlashInfo;
@@ -520,7 +520,7 @@ void DoUserDialog(void)
}
rb->lcd_puts(0, 3, "using file:");
- rb->lcd_puts(0, 4, FILENAME);
+ rb->lcd_puts_scroll(0, 4, filename);
rb->lcd_puts(0, 6, "[F1] to check file");
rb->lcd_puts(0, 7, "other key to exit");
rb->lcd_update();
@@ -540,7 +540,7 @@ void DoUserDialog(void)
space = FlashInfo.size - (pos-FB + sizeof(ImageHeader));
/* size minus start */
- rc = CheckImageFile(FILENAME, space, &ImageHeader);
+ rc = CheckImageFile(filename, space, &ImageHeader);
rb->lcd_puts(0, 0, "checked:");
switch (rc) {
case eOK:
@@ -559,9 +559,8 @@ void DoUserDialog(void)
rb->lcd_puts(0, 4, " --10 rockbox.bin");
break;
case eFileNotFound:
- rb->lcd_puts(0, 1, "File not found.");
- rb->lcd_puts(0, 2, "Put this in root:");
- rb->lcd_puts(0, 4, FILENAME);
+ rb->lcd_puts(0, 1, "File not found:");
+ rb->lcd_puts_scroll(0, 2, filename);
break;
case eTooBig:
rb->lcd_puts(0, 1, "File too big,");
@@ -616,7 +615,7 @@ void DoUserDialog(void)
rb->lcd_puts(0, 0, "Programming...");
rb->lcd_update();
- rc = ProgramImageFile(FILENAME, pos, &ImageHeader, UCL_HEADER, true_size);
+ rc = ProgramImageFile(filename, pos, &ImageHeader, UCL_HEADER, true_size);
if (rc)
{ /* errors */
rb->lcd_clear_display();
@@ -633,7 +632,7 @@ void DoUserDialog(void)
rb->lcd_puts(0, 0, "Verifying...");
rb->lcd_update();
- rc = VerifyImageFile(FILENAME, pos, &ImageHeader, UCL_HEADER, true_size);
+ rc = VerifyImageFile(filename, pos, &ImageHeader, UCL_HEADER, true_size);
rb->lcd_clear_display();
if (rc == 0)
@@ -671,19 +670,22 @@ void DoUserDialog(void)
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
{
+ char* filename;
+
/* 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);
- /* if you don't use the parameter, you can do like
- this to avoid the compiler warning about it */
- (void)parameter;
+ if (parameter == NULL)
+ filename = DEFAULT_FILENAME;
+ else
+ filename = (char*) parameter;
rb = api; /* copy to global api pointer */
/* now go ahead and have fun! */
- DoUserDialog();
+ DoUserDialog(filename);
return PLUGIN_OK;
}