mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-14 20:18:35 -07:00
@@ -71,6 +71,8 @@ void tracker_interrupt_init(float freq, FuriHalInterruptISR isr, void* context)
|
||||
tracker_isr = isr;
|
||||
tracker_isr_context = context;
|
||||
|
||||
furi_hal_bus_enable(FuriHalBusTIM2);
|
||||
|
||||
furi_hal_interrupt_set_isr(FuriHalInterruptIdTIM2, tracker_interrupt_cb, NULL);
|
||||
|
||||
LL_TIM_InitTypeDef TIM_InitStruct = {0};
|
||||
@@ -88,7 +90,7 @@ void tracker_interrupt_init(float freq, FuriHalInterruptISR isr, void* context)
|
||||
|
||||
void tracker_interrupt_deinit() {
|
||||
FURI_CRITICAL_ENTER();
|
||||
LL_TIM_DeInit(TIM2);
|
||||
furi_hal_bus_disable(FuriHalBusTIM2);
|
||||
FURI_CRITICAL_EXIT();
|
||||
|
||||
furi_hal_interrupt_set_isr(FuriHalInterruptIdTIM2, NULL, NULL);
|
||||
|
||||
5
applications/external/tama_p1/tama_p1.c
vendored
5
applications/external/tama_p1/tama_p1.c
vendored
@@ -1,4 +1,5 @@
|
||||
#include <furi.h>
|
||||
#include <furi_hal_bus.h>
|
||||
#include <gui/gui.h>
|
||||
#include <input/input.h>
|
||||
#include <storage/storage.h>
|
||||
@@ -750,6 +751,9 @@ static void tama_p1_init(TamaApp* const ctx) {
|
||||
if(ctx->rom != NULL) {
|
||||
// Init TIM2
|
||||
// 64KHz
|
||||
|
||||
furi_hal_bus_enable(FuriHalBusTIM2);
|
||||
|
||||
LL_TIM_InitTypeDef tim_init = {
|
||||
.Prescaler = 999,
|
||||
.CounterMode = LL_TIM_COUNTERMODE_UP,
|
||||
@@ -782,6 +786,7 @@ static void tama_p1_deinit(TamaApp* const ctx) {
|
||||
if(ctx->rom != NULL) {
|
||||
tamalib_release();
|
||||
furi_thread_free(ctx->thread);
|
||||
furi_hal_bus_disable(FuriHalBusTIM2);
|
||||
free(ctx->rom);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user