Skip to content

Commit b95baad

Browse files
author
Veijo Pesonen
committed
Fixes OOB UART mutex acquisition
1 parent 215a1d7 commit b95baad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ESP8266/ESP8266.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,13 +595,13 @@ int32_t ESP8266::_recv_tcp_passive(int id, void *data, uint32_t amount, uint32_t
595595
int32_t len;
596596
int32_t ret = (int32_t)NSAPI_ERROR_WOULD_BLOCK;
597597

598+
_smutex.lock();
599+
598600
// No flow control, drain the USART receive register ASAP to avoid data overrun
599601
if (_serial_rts == NC) {
600602
_process_oob(timeout, true);
601603
}
602604

603-
_smutex.lock();
604-
605605
// NOTE: documentation v3.0 says '+CIPRECVDATA:<data_len>,' but it's not how the FW responds...
606606
bool done = _parser.send("AT+CIPRECVDATA=%d,%lu", id, amount)
607607
&& _parser.recv("+CIPRECVDATA,%ld:", &len)

0 commit comments

Comments
 (0)