Better way of doing favorite timeout

This commit is contained in:
Willy-JL
2024-01-31 02:45:11 +00:00
parent f3763b2681
commit ae9a719eb8
6 changed files with 21 additions and 12 deletions

View File

@@ -2,6 +2,8 @@
#include "nfc_app_i.h"
#include <xtreme/xtreme.h>
#define NFC_EMULATION_TIME_MAX_MS (5 * 60 * 1000)
FuriTimer* timer_auto_exit;
@@ -20,7 +22,11 @@ void nfc_scene_emulate_on_enter(void* context) {
timer_auto_exit =
furi_timer_alloc(nfc_scene_emulate_timer_callback, FuriTimerTypeOnce, instance);
furi_timer_start(timer_auto_exit, NFC_EMULATION_TIME_MAX_MS);
furi_timer_start(
timer_auto_exit,
instance->fav_timeout ?
xtreme_settings.favorite_timeout * furi_kernel_get_tick_frequency() :
NFC_EMULATION_TIME_MAX_MS);
}
bool nfc_scene_emulate_on_event(void* context, SceneManagerEvent event) {