summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorØyvind Harboe <oyvind.harboe@zylin.com>2011-03-15 09:39:20 +0100
committerØyvind Harboe <oyvind.harboe@zylin.com>2011-03-15 09:52:37 +0100
commit689c244389798ef7fc041693831ae114b3063d36 (patch)
treef47a4dee1291cc31ef79a1103ff4da4a510da4c6
parent59a6380a1701e0a270ad0fa08c6636f30705ba0c (diff)
downloadopenocd_libswd-689c244389798ef7fc041693831ae114b3063d36.tar.gz
openocd_libswd-689c244389798ef7fc041693831ae114b3063d36.tar.bz2
openocd_libswd-689c244389798ef7fc041693831ae114b3063d36.tar.xz
openocd_libswd-689c244389798ef7fc041693831ae114b3063d36.zip
zy1000: reduce memory usage for fw upgrade fn
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
-rw-r--r--src/jtag/zy1000/zy1000.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/jtag/zy1000/zy1000.c b/src/jtag/zy1000/zy1000.c
index 69fa4dc8..3344e0ee 100644
--- a/src/jtag/zy1000/zy1000.c
+++ b/src/jtag/zy1000/zy1000.c
@@ -438,24 +438,10 @@ struct cyg_upgrade_info firmware_info =
report_info,
};
+// File written to /ram/firmware.phi before arriving at this fn
static int jim_zy1000_writefirmware(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
- if (argc != 2)
- return JIM_ERR;
-
- int length;
- const char *str = Jim_GetString(argv[1], &length);
-
- /* */
- int tmpFile;
- if ((tmpFile = open(firmware_info.file, O_RDWR | O_CREAT | O_TRUNC)) <= 0)
- {
- return JIM_ERR;
- }
- bool success;
- success = write(tmpFile, str, length) == length;
- close(tmpFile);
- if (!success)
+ if (argc != 1)
return JIM_ERR;
if (!cyg_firmware_upgrade(NULL, firmware_info))