Skip to content

Commit 148a93e

Browse files
committed
pbio/os: Make timer test safe if start is in the future.
1 parent 54438fd commit 148a93e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/pbio/src/os.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void pbio_os_timer_extend(pbio_os_timer_t *timer) {
4242
* @return Whether the timer has expired.
4343
*/
4444
bool pbio_os_timer_is_expired(pbio_os_timer_t *timer) {
45-
return pbdrv_clock_get_ms() - timer->start >= timer->duration;
45+
return pbio_util_time_has_passed(pbdrv_clock_get_ms(), timer->start + timer->duration);
4646
}
4747

4848
/**

0 commit comments

Comments
 (0)