Skip to content

Commit 08487af

Browse files
committed
Fix unexpected timer behaviour
1 parent a2fd52c commit 08487af

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

firmware/targets/f7/furi_hal/furi_hal_nfc_timer.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,14 @@ static void furi_hal_nfc_timer_start_core_ticks(FuriHalNfcTimer timer, uint64_t
139139
furi_check(arr_reg <= UINT16_MAX);
140140

141141
LL_TIM_DisableIT_UPDATE(furi_hal_nfc_timers[timer].timer);
142+
142143
LL_TIM_SetPrescaler(furi_hal_nfc_timers[timer].timer, prescaler);
144+
LL_TIM_SetAutoReload(furi_hal_nfc_timers[timer].timer, arr_reg);
145+
143146
LL_TIM_GenerateEvent_UPDATE(furi_hal_nfc_timers[timer].timer);
147+
while(!LL_TIM_IsActiveFlag_UPDATE(furi_hal_nfc_timers[timer].timer));
144148
LL_TIM_ClearFlag_UPDATE(furi_hal_nfc_timers[timer].timer);
145149

146-
LL_TIM_SetAutoReload(furi_hal_nfc_timers[timer].timer, arr_reg);
147-
148150
LL_TIM_EnableIT_UPDATE(furi_hal_nfc_timers[timer].timer);
149151
LL_TIM_EnableCounter(furi_hal_nfc_timers[timer].timer);
150152
#ifdef FURI_HAL_NFC_TIMER_DEBUG

0 commit comments

Comments
 (0)