1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-19 08:52:15 +01:00

Implement Do-Not-Verify-After-Upload preference for Serial Uploads

This commit is contained in:
gh-megabit 2016-04-15 21:15:34 +01:00
parent c99ab12446
commit 4b64ef74ba
3 changed files with 22 additions and 2 deletions

View File

@ -70,6 +70,7 @@ public abstract class Uploader implements MessageConsumer {
} }
protected final boolean verbose; protected final boolean verbose;
protected final boolean verifyUpload;
private String error; private String error;
protected boolean notFoundError; protected boolean notFoundError;
@ -77,11 +78,13 @@ public abstract class Uploader implements MessageConsumer {
protected Uploader() { protected Uploader() {
this.verbose = PreferencesData.getBoolean("upload.verbose"); this.verbose = PreferencesData.getBoolean("upload.verbose");
this.verifyUpload = PreferencesData.getBoolean("upload.verify");
init(false); init(false);
} }
protected Uploader(boolean nup) { protected Uploader(boolean nup) {
this.verbose = PreferencesData.getBoolean("upload.verbose"); this.verbose = PreferencesData.getBoolean("upload.verbose");
this.verifyUpload = PreferencesData.getBoolean("upload.verify");
init(nup); init(nup);
} }

View File

@ -102,6 +102,11 @@ public class SerialUploader extends Uploader {
else else
prefs.put("upload.verbose", prefs.getOrExcept("upload.params.quiet")); 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; boolean uploadResult;
try { try {
String pattern = prefs.getOrExcept("upload.pattern"); String pattern = prefs.getOrExcept("upload.pattern");
@ -192,6 +197,11 @@ public class SerialUploader extends Uploader {
prefs.put("upload.verbose", prefs.getOrExcept("upload.params.quiet")); 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; boolean uploadResult;
try { try {
String pattern = prefs.getOrExcept("upload.pattern"); String pattern = prefs.getOrExcept("upload.pattern");
@ -318,6 +328,11 @@ public class SerialUploader extends Uploader {
else else
prefs.put("program.verbose", prefs.getOrExcept("program.params.quiet")); 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 { try {
// if (prefs.get("program.disable_flushing") == null // if (prefs.get("program.disable_flushing") == null
// || prefs.get("program.disable_flushing").toLowerCase().equals("false")) // || prefs.get("program.disable_flushing").toLowerCase().equals("false"))

View File

@ -97,11 +97,13 @@ tools.avrdude.config.path={path}/etc/avrdude.conf
tools.avrdude.upload.params.verbose=-v tools.avrdude.upload.params.verbose=-v
tools.avrdude.upload.params.quiet=-q -q 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.verbose=-v
tools.avrdude.program.params.quiet=-q -q 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.verbose=-v
tools.avrdude.erase.params.quiet=-q -q tools.avrdude.erase.params.quiet=-q -q