From 4b64ef74ba5fd8e298a8fa7d43bb3910540fc344 Mon Sep 17 00:00:00 2001 From: gh-megabit Date: Fri, 15 Apr 2016 21:15:34 +0100 Subject: [PATCH] Implement Do-Not-Verify-After-Upload preference for Serial Uploads --- .../src/cc/arduino/packages/Uploader.java | 3 +++ .../packages/uploaders/SerialUploader.java | 15 +++++++++++++++ hardware/arduino/avr/platform.txt | 6 ++++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/arduino-core/src/cc/arduino/packages/Uploader.java b/arduino-core/src/cc/arduino/packages/Uploader.java index cd9a11a45..5354d7521 100644 --- a/arduino-core/src/cc/arduino/packages/Uploader.java +++ b/arduino-core/src/cc/arduino/packages/Uploader.java @@ -70,6 +70,7 @@ public abstract class Uploader implements MessageConsumer { } protected final boolean verbose; + protected final boolean verifyUpload; private String error; protected boolean notFoundError; @@ -77,11 +78,13 @@ public abstract class Uploader implements MessageConsumer { protected Uploader() { this.verbose = PreferencesData.getBoolean("upload.verbose"); + this.verifyUpload = PreferencesData.getBoolean("upload.verify"); init(false); } protected Uploader(boolean nup) { this.verbose = PreferencesData.getBoolean("upload.verbose"); + this.verifyUpload = PreferencesData.getBoolean("upload.verify"); init(nup); } diff --git a/arduino-core/src/cc/arduino/packages/uploaders/SerialUploader.java b/arduino-core/src/cc/arduino/packages/uploaders/SerialUploader.java index d59325a5c..aa9ac4c07 100644 --- a/arduino-core/src/cc/arduino/packages/uploaders/SerialUploader.java +++ b/arduino-core/src/cc/arduino/packages/uploaders/SerialUploader.java @@ -102,6 +102,11 @@ public class SerialUploader extends Uploader { else prefs.put("upload.verbose", prefs.getOrExcept("upload.params.quiet")); + if (verifyUpload) + prefs.put("upload.verify", prefs.get("upload.params.verify", "")); + else + prefs.put("upload.verify", prefs.get("upload.params.noverify", "")); + boolean uploadResult; try { String pattern = prefs.getOrExcept("upload.pattern"); @@ -192,6 +197,11 @@ public class SerialUploader extends Uploader { prefs.put("upload.verbose", prefs.getOrExcept("upload.params.quiet")); } + if (verifyUpload) + prefs.put("upload.verify", prefs.get("upload.params.verify", "")); + else + prefs.put("upload.verify", prefs.get("upload.params.noverify", "")); + boolean uploadResult; try { String pattern = prefs.getOrExcept("upload.pattern"); @@ -318,6 +328,11 @@ public class SerialUploader extends Uploader { else prefs.put("program.verbose", prefs.getOrExcept("program.params.quiet")); + if (verifyUpload) + prefs.put("program.verify", prefs.get("program.params.verify", "")); + else + prefs.put("program.verify", prefs.get("program.params.noverify", "")); + try { // if (prefs.get("program.disable_flushing") == null // || prefs.get("program.disable_flushing").toLowerCase().equals("false")) diff --git a/hardware/arduino/avr/platform.txt b/hardware/arduino/avr/platform.txt index ed80bacec..08171ad7f 100644 --- a/hardware/arduino/avr/platform.txt +++ b/hardware/arduino/avr/platform.txt @@ -97,11 +97,13 @@ tools.avrdude.config.path={path}/etc/avrdude.conf tools.avrdude.upload.params.verbose=-v tools.avrdude.upload.params.quiet=-q -q -tools.avrdude.upload.pattern="{cmd.path}" "-C{config.path}" {upload.verbose} -p{build.mcu} -c{upload.protocol} -P{serial.port} -b{upload.speed} -D "-Uflash:w:{build.path}/{build.project_name}.hex:i" +tools.avrdude.upload.params.noverify=-V +tools.avrdude.upload.pattern="{cmd.path}" "-C{config.path}" {upload.verbose} {upload.verify} -p{build.mcu} -c{upload.protocol} -P{serial.port} -b{upload.speed} -D "-Uflash:w:{build.path}/{build.project_name}.hex:i" tools.avrdude.program.params.verbose=-v tools.avrdude.program.params.quiet=-q -q -tools.avrdude.program.pattern="{cmd.path}" "-C{config.path}" {program.verbose} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{build.path}/{build.project_name}.hex:i" +tools.avrdude.program.params.noverify=-V +tools.avrdude.program.pattern="{cmd.path}" "-C{config.path}" {program.verbose} {program.verify} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{build.path}/{build.project_name}.hex:i" tools.avrdude.erase.params.verbose=-v tools.avrdude.erase.params.quiet=-q -q