|
|
@@ -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);
|
|
|
}
|
|
|
}
|
|
|
@@ -830,9 +835,9 @@ int32_t tama_p1_app(void* p) {
|
|
|
btn_state_t tama_btn_state = 0; // BTN_STATE_RELEASED is 0
|
|
|
|
|
|
if(in_menu) {
|
|
|
- // if(menu_cursor >= 2 &&
|
|
|
- // (event.input.key == InputKeyUp || event.input.key == InputKeyDown)) {
|
|
|
- // tama_btn_state = BTN_STATE_RELEASED;
|
|
|
+ // if(menu_cursor == 2 &&
|
|
|
+ // (event.input.key == InputKeyUp || event.input.key == InputKeyDown)) {
|
|
|
+ // tama_btn_state = BTN_STATE_RELEASED;
|
|
|
// }
|
|
|
if(event.input.key == InputKeyBack) {
|
|
|
tama_btn_state = BTN_STATE_RELEASED;
|
|
|
@@ -1128,7 +1133,7 @@ int32_t tama_p1_app(void* p) {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- } else { // out of menu
|
|
|
+ } else { // out of menu // TODO: clean up code -.-
|
|
|
if(event.input.key == InputKeyBack && event.input.type == InputTypeLong) {
|
|
|
if(speed != 1) {
|
|
|
speed = 1;
|