From: Øyvind Harboe Date: Tue, 15 Mar 2011 08:39:20 +0000 (+0100) Subject: zy1000: reduce memory usage for fw upgrade fn X-Git-Tag: v0.5.0-rc1~142 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=689c244389798ef7fc041693831ae114b3063d36;p=openocd zy1000: reduce memory usage for fw upgrade fn Signed-off-by: Øyvind Harboe --- 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))