mirror of
https://github.com/firewalkwithm3/Sensor-Watch.git
synced 2024-11-22 11:10:29 +08:00
avoid delta overflow in countdown draw
This commit is contained in:
parent
0ad5fa4733
commit
dcd4d12c0a
|
@ -87,6 +87,9 @@ static void draw(countdown_state_t *state, uint8_t subsecond) {
|
|||
|
||||
switch (state->mode) {
|
||||
case cd_running:
|
||||
if (state->target_ts <= state->now_ts)
|
||||
delta = 0;
|
||||
else
|
||||
delta = state->target_ts - state->now_ts;
|
||||
result = div(delta, 60);
|
||||
state->seconds = result.rem;
|
||||
|
|
Loading…
Reference in a new issue