Просмотр исходного кода

Workaround for furi_hal_gpio_add_int_callback conflict with expansion

Thanks @Willy-JL for all details about this issue
MX 1 год назад
Родитель
Сommit
e5f29ad68d
1 измененных файлов с 9 добавлено и 0 удалено
  1. 9 0
      flipper_atomicdiceroller.c

+ 9 - 0
flipper_atomicdiceroller.c

@@ -11,6 +11,7 @@
 #include <locale/locale.h>
 #include <toolbox/crc32_calc.h>
 #include <mbedtls/md5.h>
+#include <expansion/expansion.h>
 
 #define SCREEN_SIZE_X 128
 #define SCREEN_SIZE_Y 64
@@ -96,6 +97,9 @@ static void gpiocallback(void* ctx) {
 }
 
 int32_t flipper_atomicdiceroller_app() {
+    Expansion* expansion = furi_record_open(RECORD_EXPANSION);
+    expansion_disable(expansion);
+    
     furi_hal_bus_enable(FuriHalBusTIM2);
     LL_TIM_SetCounterMode(TIM2, LL_TIM_COUNTERMODE_UP);
     LL_TIM_SetClockDivision(TIM2, LL_TIM_CLOCKDIVISION_DIV1);
@@ -119,6 +123,8 @@ int32_t flipper_atomicdiceroller_app() {
     mutexVal.mutex = furi_mutex_alloc(FuriMutexTypeNormal);
     if(!mutexVal.mutex) {
         furi_message_queue_free(event_queue);
+        expansion_enable(expansion);
+        furi_record_close(RECORD_EXPANSION);
         return 255;
     }
 
@@ -350,5 +356,8 @@ int32_t flipper_atomicdiceroller_app() {
     furi_timer_free(timerPause);
     furi_record_close(RECORD_GUI);
 
+    expansion_enable(expansion);
+    furi_record_close(RECORD_EXPANSION);
+
     return 0;
 }