1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-12 04:34:43 +04:00

[FL-3655] Dolphin: Extreme butthurt loop fix (#3184)

* Furi: change timer restart function signature, explicitly require timer time. Dolphin: fix incorrect timer usage caused by refactoring.
* Format Sources
* Furi: update timer documentation
This commit is contained in:
あく
2023-11-02 00:23:02 +09:00
committed by GitHub
parent aa06328516
commit 47cc05dab4
5 changed files with 20 additions and 14 deletions

View File

@@ -155,9 +155,9 @@ int32_t dolphin_srv(void* p) {
furi_record_create(RECORD_DOLPHIN, dolphin);
dolphin_state_load(dolphin->state);
furi_timer_stop(dolphin->butthurt_timer);
furi_timer_restart(dolphin->butthurt_timer, HOURS_IN_TICKS(2 * 24));
dolphin_update_clear_limits_timer_period(dolphin);
furi_timer_stop(dolphin->clear_limits_timer);
furi_timer_restart(dolphin->clear_limits_timer, HOURS_IN_TICKS(24));
DolphinEvent event;
while(1) {
@@ -167,8 +167,8 @@ int32_t dolphin_srv(void* p) {
dolphin_state_on_deed(dolphin->state, event.deed);
DolphinPubsubEvent event = DolphinPubsubEventUpdate;
furi_pubsub_publish(dolphin->pubsub, &event);
furi_timer_restart(dolphin->butthurt_timer);
furi_timer_restart(dolphin->flush_timer);
furi_timer_restart(dolphin->butthurt_timer, HOURS_IN_TICKS(2 * 24));
furi_timer_restart(dolphin->flush_timer, 30 * 1000);
} else if(event.type == DolphinEventTypeStats) {
event.stats->icounter = dolphin->state->data.icounter;
event.stats->butthurt = dolphin->state->data.butthurt;