...
This commit is contained in:
parent
ab24175145
commit
95427488d6
@ -275,10 +275,13 @@ unset_alarm(ID):-
|
|||||||
unset_alarm(ID):-
|
unset_alarm(ID):-
|
||||||
alarm(0, true, Remaining),
|
alarm(0, true, Remaining),
|
||||||
bb_get(alarms, Alarms),
|
bb_get(alarms, Alarms),
|
||||||
|
[alarm(Seconds, _, _)|_] = Alarms,
|
||||||
|
Elapsed is Seconds - Remaining - 1,
|
||||||
delete_alarm(Alarms, ID, NewAlarms),
|
delete_alarm(Alarms, ID, NewAlarms),
|
||||||
bb_put(alarms, NewAlarms),
|
bb_put(alarms, NewAlarms),
|
||||||
(NewAlarms = [alarm(Seconds, _, _)|_] ->
|
(NewAlarms = [alarm(NewSeconds, _, _)|_] ->
|
||||||
alarm(Seconds, alarm_handler, _)
|
RemainingSeconds is NewSeconds - Elapsed,
|
||||||
|
alarm(RemainingSeconds, alarm_handler, _)
|
||||||
;
|
;
|
||||||
true
|
true
|
||||||
).
|
).
|
||||||
|
Reference in New Issue
Block a user