Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
eyr1n committed Oct 29, 2024
1 parent 0248d93 commit 5c5ff2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/uart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ bool UART::transmit(const uint8_t *data, size_t size) {
}

bool UART::receive(uint8_t *data, size_t size, uint32_t timeout) {
TimeOut_t timeout_state;
vTaskSetTimeOutState(&timeout_state);
ScopedLock lock(rx_mutex_);
if (!lock.acquire(timeout)) {
return false;
}
TimeOut_t timeout_state;
vTaskSetTimeOutState(&timeout_state);
while (available() < size) {
if (xTaskCheckForTimeOut(&timeout_state, &timeout) != pdFALSE) {
break;
Expand Down

0 comments on commit 5c5ff2a

Please sign in to comment.