Skip to content

Commit 12c7623

Browse files
committed
Merge igrr/esp8266 into esp8266
* commit '8b081ebe9682d92ea4fab8bd233342580d36a7eb': Enable reset control for generic esp8266 boards Corrected accidentally committed wrong file Added to configuration options to disable ArduinoIDE SerialMonitor to set DTR and RTS active when the Monitor is opened
2 parents 372076c + 8b081eb commit 12c7623

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

arduino-core/src/processing/app/Serial.java

+14-6
Original file line numberDiff line numberDiff line change
@@ -57,27 +57,35 @@ public Serial() throws SerialException {
5757
PreferencesData.getInteger("serial.debug_rate"),
5858
PreferencesData.get("serial.parity").charAt(0),
5959
PreferencesData.getInteger("serial.databits"),
60-
new Float(PreferencesData.get("serial.stopbits")).floatValue());
60+
new Float(PreferencesData.get("serial.stopbits")).floatValue(),
61+
BaseNoGui.getBoardPreferences().get("serial.disableRTS") == null,
62+
BaseNoGui.getBoardPreferences().get("serial.disableDTR") == null);
6163
}
6264

6365
public Serial(int irate) throws SerialException {
6466
this(PreferencesData.get("serial.port"), irate,
6567
PreferencesData.get("serial.parity").charAt(0),
6668
PreferencesData.getInteger("serial.databits"),
67-
new Float(PreferencesData.get("serial.stopbits")).floatValue());
69+
new Float(PreferencesData.get("serial.stopbits")).floatValue(),
70+
BaseNoGui.getBoardPreferences().get("serial.disableRTS") == null,
71+
BaseNoGui.getBoardPreferences().get("serial.disableDTR") == null);
6872
}
6973

7074
public Serial(String iname, int irate) throws SerialException {
7175
this(iname, irate, PreferencesData.get("serial.parity").charAt(0),
7276
PreferencesData.getInteger("serial.databits"),
73-
new Float(PreferencesData.get("serial.stopbits")).floatValue());
77+
new Float(PreferencesData.get("serial.stopbits")).floatValue(),
78+
BaseNoGui.getBoardPreferences().get("serial.disableRTS") == null,
79+
BaseNoGui.getBoardPreferences().get("serial.disableDTR") == null);
7480
}
7581

7682
public Serial(String iname) throws SerialException {
7783
this(iname, PreferencesData.getInteger("serial.debug_rate"),
7884
PreferencesData.get("serial.parity").charAt(0),
7985
PreferencesData.getInteger("serial.databits"),
80-
new Float(PreferencesData.get("serial.stopbits")).floatValue());
86+
new Float(PreferencesData.get("serial.stopbits")).floatValue(),
87+
BaseNoGui.getBoardPreferences().get("serial.disableRTS") == null,
88+
BaseNoGui.getBoardPreferences().get("serial.disableDTR") == null);
8189
}
8290

8391
public static boolean touchPort(String iname, int irate) throws SerialException {
@@ -100,7 +108,7 @@ public static boolean touchPort(String iname, int irate) throws SerialException
100108
}
101109
}
102110

103-
public Serial(String iname, int irate, char iparity, int idatabits, float istopbits) throws SerialException {
111+
public Serial(String iname, int irate, char iparity, int idatabits, float istopbits, boolean setRTS, boolean setDTR) throws SerialException {
104112
//if (port != null) port.close();
105113
//this.parent = parent;
106114
//parent.attach(this);
@@ -120,7 +128,7 @@ public Serial(String iname, int irate, char iparity, int idatabits, float istopb
120128
try {
121129
port = new SerialPort(iname);
122130
port.openPort();
123-
port.setParams(rate, databits, stopbits, parity, true, true);
131+
port.setParams(rate, databits, stopbits, parity, setRTS, setDTR);
124132
port.addEventListener(this);
125133
} catch (Exception e) {
126134
throw new SerialException(I18n.format(_("Error opening serial port ''{0}''."), iname), e);

hardware/esp8266com/esp8266/boards.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ esp01.name=Generic ESP8266 board
55

66
esp01.upload.tool=esptool
77
esp01.upload.speed=115200
8-
esp01.upload.resetmethod=none
8+
esp01.upload.resetmethod=ck
99
esp01.upload.maximum_size=524288
1010
esp01.upload.wait_for_upload_port=true
11+
esp01.serial.disableDTR=true
12+
esp01.serial.disableRTS=true
1113

1214
esp01.build.mcu=esp8266
1315
esp01.build.f_cpu=80000000L

0 commit comments

Comments
 (0)