Skip to content

Commit

Permalink
For now disable 4way-if timeout (betaflight#13364)
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveCEvans authored Feb 13, 2024
1 parent 3ef7a18 commit 76e225a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/io/serial_4way.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,13 +396,19 @@ static serialPort_t *port;

static bool ReadByte(uint8_t *data, timeDelta_t timeoutUs)
{
// need timedOut?
#ifdef USE_TIMEOUT_4WAYIF
timeUs_t startTime = micros();
while (!serialRxBytesWaiting(port)) {
if (timeoutUs && (cmpTimeUs(micros(), startTime) > timeoutUs)) {
return true;
}
}
#else
UNUSED(timeoutUs);

// Wait indefinitely
while (!serialRxBytesWaiting(port));
#endif

*data = serialRead(port);

Expand Down

0 comments on commit 76e225a

Please sign in to comment.