Skip to content

Commit

Permalink
Fix conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
loostrum committed Feb 6, 2024
1 parent 6a910fc commit cc421f4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions device/PowerSensor/PowerSensor.ino
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,10 @@ void JumpToBootloader() {
inline void wait_for_host(int nbytes) {
unsigned long tstart = millis();
while (Serial.read() < nbytes) {
if ((millis() - tstart) > TIMEOUT);
// host is taking too long, assume connection broken and reset device
NVIC_SystemReset();
if ((millis() - tstart) > TIMEOUT) {
// host is taking too long, assume connection broken and reset device
NVIC_SystemReset();
}
}
}

Expand Down

0 comments on commit cc421f4

Please sign in to comment.