IDEChannel: Fix wait_until_not_busy() (#7084)

The time_elapsed variable would count until milliseconds_timeout + 1,
so a != comparision won't work.
This commit is contained in:
Alexander Richards 2021-05-13 19:11:14 +02:00 committed by GitHub
parent 8693c925a0
commit 28a6a9a08f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -269,7 +269,7 @@ bool IDEChannel::wait_until_not_busy(bool slave, size_t milliseconds_timeout)
IO::delay(1000);
time_elapsed++;
}
return time_elapsed != milliseconds_timeout;
return time_elapsed <= milliseconds_timeout;
}
bool IDEChannel::wait_until_not_busy(size_t milliseconds_timeout)
@ -279,7 +279,7 @@ bool IDEChannel::wait_until_not_busy(size_t milliseconds_timeout)
IO::delay(1000);
time_elapsed++;
}
return time_elapsed != milliseconds_timeout;
return time_elapsed <= milliseconds_timeout;
}
String IDEChannel::channel_type_string() const