Skip to content

Commit 176f92b

Browse files
committed
fix(openthread): tx queue error
1 parent f9d1e55 commit 176f92b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libraries/OpenThread/src/OThreadCLI.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ void OpenThreadCLI::end() {
354354

355355

356356
size_t OpenThreadCLI::write(uint8_t c) {
357-
if (rx_queue == NULL) {
357+
if (tx_queue == NULL) {
358358
return 0;
359359
}
360360
if (xQueueSend(tx_queue, &c, 0) != pdPASS) {
@@ -416,6 +416,9 @@ int OpenThreadCLI::read(void) {
416416
}
417417

418418
void OpenThreadCLI::flush() {
419+
if (tx_queue == NULL) {
420+
return;
421+
}
419422
// wait for the TX Queue to be empty
420423
while (uxQueueMessagesWaiting(tx_queue));
421424
}

0 commit comments

Comments
 (0)