1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-01 12:24:14 +01:00

Preventing upload and serial monitor on not (yet) available boards

This commit is contained in:
Federico Fissore 2013-10-11 09:36:04 +02:00
parent 9898fd7ae6
commit 06445dd151
2 changed files with 11 additions and 0 deletions

View File

@ -2512,6 +2512,12 @@ public class Editor extends JFrame implements RunnerListener {
}
BoardPort port = Base.getDiscoveryManager().find(Preferences.get("serial.port"));
if (port == null) {
statusError(I18n.format("Board at {0} is not available", Preferences.get("serial.port")));
return;
}
serialMonitor = new UploaderAndMonitorFactory().newMonitor(port, base);
serialMonitor.setIconImage(getIconImage());

View File

@ -1670,6 +1670,11 @@ public class Sketch {
BoardPort boardPort = Base.getDiscoveryManager().find(Preferences.get("serial.port"));
if (boardPort == null) {
editor.statusError(I18n.format("Board at {0} is not available", Preferences.get("serial.port")));
return false;
}
Uploader uploader = new UploaderAndMonitorFactory().newUploader(target.getBoards().get(board), boardPort);
boolean success = false;