Skip to content

Commit 92ef9e8

Browse files
author
Veijo Pesonen
committed
Fixes compiler error on boards without UART flow control
1 parent 3c6376c commit 92ef9e8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

ESP8266/ESP8266.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ struct ESP8266::fw_at_version ESP8266::at_version()
151151
bool ESP8266::stop_uart_hw_flow_ctrl(void)
152152
{
153153
bool done = true;
154+
#if DEVICE_SERIAL_FC
154155

155156
if (_serial_rts != NC || _serial_cts != NC) {
156157
// Stop board's flow control
@@ -161,13 +162,15 @@ bool ESP8266::stop_uart_hw_flow_ctrl(void)
161162
&& _parser.recv("OK\n");
162163
}
163164

165+
#endif
164166
return done;
165167
}
166168

167169
bool ESP8266::start_uart_hw_flow_ctrl(void)
168170
{
169171
bool done = true;
170172

173+
#if DEVICE_SERIAL_FC
171174
if (_serial_rts != NC && _serial_cts != NC) {
172175
// Start board's flow control
173176
_serial.set_flow_control(SerialBase::RTSCTS, _serial_rts, _serial_cts);
@@ -190,7 +193,11 @@ bool ESP8266::start_uart_hw_flow_ctrl(void)
190193

191194
_serial.set_flow_control(SerialBase::CTS, NC, _serial_cts);
192195
}
193-
196+
#else
197+
if (_serial_rts != NC || _serial_cts != NC) {
198+
done = false;
199+
}
200+
#endif
194201
return done;
195202
}
196203

0 commit comments

Comments
 (0)