Fix timeout checker

`Runtime.hasTimeExpired()` had a minor flaw. Because it was comparing two values
using `>` instead of `>=`, it meant that a timeout set at 20ms wouldn't actually
time out until 21ms elapsed.

Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
pull/1030/head
Michael Richters 4 years ago
parent 3a8eb5d839
commit 18a8e728f2
No known key found for this signature in database
GPG Key ID: 1288FD13E4EEF0C0

@ -124,7 +124,7 @@ class Runtime_ {
static bool hasTimeExpired(_Timestamp start_time, _Timeout ttl) { static bool hasTimeExpired(_Timestamp start_time, _Timeout ttl) {
_Timestamp current_time = millis_at_cycle_start_; _Timestamp current_time = millis_at_cycle_start_;
_Timestamp elapsed_time = current_time - start_time; _Timestamp elapsed_time = current_time - start_time;
return (elapsed_time > ttl); return (elapsed_time >= ttl);
} }
EventHandlerResult onFocusEvent(const char *command) { EventHandlerResult onFocusEvent(const char *command) {

Loading…
Cancel
Save