From a8e517e441321234408c33a742e861f0bba56184 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 12 May 2011 18:10:00 +0000 Subject: install updates from Uros git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3597 42af7a65-404d-4744-a932-0658087f49c3 --- apps/system/install/install.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'apps/system') diff --git a/apps/system/install/install.c b/apps/system/install/install.c index f1fe7207e..2f11c6434 100755 --- a/apps/system/install/install.c +++ b/apps/system/install/install.c @@ -64,7 +64,7 @@ const char *install_help = "Installs XIP program into flash and creates a start-up script in the\n" "destination directory.\n\n" "Usage:\t%s [options] source-file.xip destination-directory\n\n" - "Example:\n\t%s --stack 1024 demo.xip /usr/bin\n\n" + "Example:\n\t%s --stack 1024 /sdcard/demo.xip /usr/bin\n\n" "Options:\n" "\t--stack \n" "\t--priority \n" @@ -77,7 +77,7 @@ const char *install_script_text = "# XIP stacksize=%x priority=%x size=%x\n"; const char *install_script_exec = - "exec %x\n"; + "exec 0x%x\n"; /**************************************************************************** @@ -88,12 +88,13 @@ int install_getstartpage(int startpage, int pagemargin, int desiredsize) { uint16_t page = 0, stpage = 0xFFFF; uint16_t pagesize = 0; - int maxlen = 0, maxlen_start = 0xFFFF; - int status; + int maxlen = -1; + int maxlen_start = 0xFFFF; + int status; for (status=0, page=0; status >= 0; page++) { - status = up_progmem_ispageerased(page); + status = up_progmem_ispageerased(page); pagesize = up_progmem_pagesize(page); /* Is this beginning of new free space section */ @@ -102,10 +103,10 @@ int install_getstartpage(int startpage, int pagemargin, int desiredsize) } else if (status != 0) { - if (stpage != 0xFFFF && up_progmem_isuniform()) { + if (stpage != 0xFFFF) { if ( (page - stpage) > maxlen) { - + if (maxlen==-1) { /* First time found sth? */ stpage += pagemargin; maxlen = 0; @@ -293,7 +294,7 @@ int install_remove(const char *scriptname) int install_main(int argc, char *argv[]) { - int i; + int i; int progsize; int scrsta; int stacksize = 4096; @@ -302,7 +303,7 @@ int install_main(int argc, char *argv[]) int startpage = 0; int startaddr = 0; int action = ACTION_INSTALL; - char scriptname[2*CONFIG_NAME_MAX]; + char scriptname[128]; /* Supported? */ -- cgit v1.2.3