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:
parent
9898fd7ae6
commit
06445dd151
@ -2512,6 +2512,12 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
BoardPort port = Base.getDiscoveryManager().find(Preferences.get("serial.port"));
|
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 = new UploaderAndMonitorFactory().newMonitor(port, base);
|
||||||
serialMonitor.setIconImage(getIconImage());
|
serialMonitor.setIconImage(getIconImage());
|
||||||
|
|
||||||
|
@ -1670,6 +1670,11 @@ public class Sketch {
|
|||||||
|
|
||||||
BoardPort boardPort = Base.getDiscoveryManager().find(Preferences.get("serial.port"));
|
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);
|
Uploader uploader = new UploaderAndMonitorFactory().newUploader(target.getBoards().get(board), boardPort);
|
||||||
|
|
||||||
boolean success = false;
|
boolean success = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user