Skip to content

Commit 934472b

Browse files
author
Veijo Pesonen
committed
esp8266 driver - don't set UART flow control if no support
1 parent 8dd6a5d commit 934472b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

components/wifi/esp8266-driver/ESP8266/ESP8266.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ struct ESP8266::fw_at_version ESP8266::at_version()
153153
bool ESP8266::stop_uart_hw_flow_ctrl(void)
154154
{
155155
bool done = true;
156+
#if DEVICE_SERIAL_FC
156157

157158
if (_serial_rts != NC || _serial_cts != NC) {
158159
// Stop board's flow control
@@ -163,15 +164,17 @@ bool ESP8266::stop_uart_hw_flow_ctrl(void)
163164
&& _parser.recv("OK\n");
164165
}
165166

167+
#endif
166168
return done;
167169
}
168170

169171
bool ESP8266::start_uart_hw_flow_ctrl(void)
170172
{
171173
bool done = true;
172174

175+
#if DEVICE_SERIAL_FC
173176
if (_serial_rts != NC && _serial_cts != NC) {
174-
// Start board's flow control
177+
// Start board's flow control
175178
_serial.set_flow_control(SerialBase::RTSCTS, _serial_rts, _serial_cts);
176179

177180
// Start ESP8266's flow control
@@ -192,7 +195,11 @@ bool ESP8266::start_uart_hw_flow_ctrl(void)
192195

193196
_serial.set_flow_control(SerialBase::CTS, NC, _serial_cts);
194197
}
195-
198+
#else
199+
if (_serial_rts != NC || _serial_cts != NC) {
200+
done = false;
201+
}
202+
#endif
196203
return done;
197204
}
198205

0 commit comments

Comments
 (0)