more checks just in case??

This commit is contained in:
MX 2023-06-03 20:36:20 +03:00
parent 2008247e65
commit a0e39ddb67
No known key found for this signature in database
GPG Key ID: 7CCC66B7DBDD1C83

View File

@ -243,11 +243,15 @@ static void digital_signal_stop_timer() {
LL_TIM_DisableUpdateEvent(TIM2);
LL_TIM_DisableDMAReq_UPDATE(TIM2);
if(furi_hal_bus_is_enabled(FuriHalBusTIM2)) {
furi_hal_bus_disable(FuriHalBusTIM2);
}
}
static void digital_signal_setup_timer() {
if(!furi_hal_bus_is_enabled(FuriHalBusTIM2)) {
furi_hal_bus_enable(FuriHalBusTIM2);
}
LL_TIM_SetCounterMode(TIM2, LL_TIM_COUNTERMODE_UP);
LL_TIM_SetClockDivision(TIM2, LL_TIM_CLOCKDIVISION_DIV1);