diff --git a/apps_source_code/flipper_geiger/flipper_geiger.c b/apps_source_code/flipper_geiger/flipper_geiger.c index 2c84b54a24b..3babd94030d 100644 --- a/apps_source_code/flipper_geiger/flipper_geiger.c +++ b/apps_source_code/flipper_geiger/flipper_geiger.c @@ -16,6 +16,8 @@ #include +#include + #define SCREEN_SIZE_X 128 #define SCREEN_SIZE_Y 64 @@ -175,6 +177,8 @@ int32_t flipper_geiger_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; } @@ -379,5 +383,8 @@ int32_t flipper_geiger_app() furi_timer_free(timer); furi_record_close(RECORD_GUI); + expansion_enable(expansion); + furi_record_close(RECORD_EXPANSION); + return 0; } \ No newline at end of file diff --git a/base_pack/flipper_i2ctools/i2ctools.c b/base_pack/flipper_i2ctools/i2ctools.c index b9fbebdbc80..4d0a438c880 100644 --- a/base_pack/flipper_i2ctools/i2ctools.c +++ b/base_pack/flipper_i2ctools/i2ctools.c @@ -1,4 +1,5 @@ #include "i2ctools_i.h" +#include void i2ctools_draw_callback(Canvas* canvas, void* ctx) { furi_assert(ctx); @@ -40,6 +41,10 @@ void i2ctools_input_callback(InputEvent* input_event, void* ctx) { int32_t i2ctools_app(void* p) { UNUSED(p); + + Expansion* expansion = furi_record_open(RECORD_EXPANSION); + expansion_disable(expansion); + FuriMessageQueue* event_queue = furi_message_queue_alloc(8, sizeof(InputEvent)); // Alloc i2ctools @@ -48,6 +53,8 @@ int32_t i2ctools_app(void* p) { if(!i2ctools->mutex) { FURI_LOG_E(APP_NAME, "cannot create mutex\r\n"); free(i2ctools); + expansion_enable(expansion); + furi_record_close(RECORD_EXPANSION); return -1; } @@ -227,5 +234,9 @@ int32_t i2ctools_app(void* p) { furi_mutex_free(i2ctools->mutex); free(i2ctools); furi_record_close(RECORD_GUI); + + expansion_enable(expansion); + furi_record_close(RECORD_EXPANSION); + return 0; } diff --git a/non_catalog_apps/air_mouse_ofw/air_mouse_app.c b/non_catalog_apps/air_mouse_ofw/air_mouse_app.c index 57edf3fbd35..9eb05d8fd54 100644 --- a/non_catalog_apps/air_mouse_ofw/air_mouse_app.c +++ b/non_catalog_apps/air_mouse_ofw/air_mouse_app.c @@ -10,6 +10,7 @@ #include "views/air_mouse_view.h" #include #include +#include #define TAG "SensorModule" @@ -211,6 +212,10 @@ static void air_mouse_free(AirMouseApp* app) { int32_t air_mouse_app(void* arg) { UNUSED(arg); + + Expansion* expansion = furi_record_open(RECORD_EXPANSION); + expansion_disable(expansion); + AirMouseApp* app = air_mouse_alloc(); app->icm42688p_device = malloc(sizeof(FuriHalSpiBusHandle)); @@ -236,5 +241,9 @@ int32_t air_mouse_app(void* arg) { free(app->icm42688p_device); air_mouse_free(app); + + expansion_enable(expansion); + furi_record_close(RECORD_EXPANSION); + return 0; } diff --git a/non_catalog_apps/flipper_atomicdiceroller/flipper_atomicdiceroller.c b/non_catalog_apps/flipper_atomicdiceroller/flipper_atomicdiceroller.c index 2da5251892c..87abc3d8768 100644 --- a/non_catalog_apps/flipper_atomicdiceroller/flipper_atomicdiceroller.c +++ b/non_catalog_apps/flipper_atomicdiceroller/flipper_atomicdiceroller.c @@ -11,6 +11,7 @@ #include #include #include +#include #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; } \ No newline at end of file diff --git a/non_catalog_apps/gb-pokemon-trading/pokemon_app.c b/non_catalog_apps/gb-pokemon-trading/pokemon_app.c index 000245b77d1..3869e740f3e 100644 --- a/non_catalog_apps/gb-pokemon-trading/pokemon_app.c +++ b/non_catalog_apps/gb-pokemon-trading/pokemon_app.c @@ -8,6 +8,8 @@ #include "pokemon_app.h" #include "pokemon_char_encode.h" +#include + const PokemonTable pokemon_table[] = { /* Values for base_*, moves, etc., pulled directly from a copy of Pokemon Blue */ {"Bulbasaur", @@ -2250,6 +2252,10 @@ void free_app(PokemonFap* pokemon_fap) { int32_t pokemon_app(void* p) { UNUSED(p); + + Expansion* expansion = furi_record_open(RECORD_EXPANSION); + expansion_disable(expansion); + PokemonFap* pokemon_fap = pokemon_alloc(); furi_hal_light_set(LightRed, 0x00); @@ -2262,5 +2268,8 @@ int32_t pokemon_app(void* p) { // Free resources free_app(pokemon_fap); + expansion_enable(expansion); + furi_record_close(RECORD_EXPANSION); + return 0; } diff --git a/non_catalog_apps/memsic_2125/memsic_2125_app.c b/non_catalog_apps/memsic_2125/memsic_2125_app.c index 9f39f8933d8..aeceb3e5dd8 100644 --- a/non_catalog_apps/memsic_2125/memsic_2125_app.c +++ b/non_catalog_apps/memsic_2125/memsic_2125_app.c @@ -28,6 +28,8 @@ Pin 6 - Vdd - Drain voltage (3.3V to 5V DC) - 3v3 #include #include +#include + #define TAG "memsic_2125_app" typedef enum { @@ -138,7 +140,9 @@ static void render_callback(Canvas* canvas, void* ctx) { // Program entry point int32_t memsic_2125_app(void* p) { UNUSED(p); - + + Expansion* expansion = furi_record_open(RECORD_EXPANSION); + expansion_disable(expansion); // Configure our initial data. DemoContext* demo_context = malloc(sizeof(DemoContext)); demo_context->data = malloc(sizeof(DemoData)); @@ -223,5 +227,8 @@ int32_t memsic_2125_app(void* p) { free(demo_context->data); free(demo_context); + expansion_enable(expansion); + furi_record_close(RECORD_EXPANSION); + return 0; } \ No newline at end of file diff --git a/non_catalog_apps/step_counter/stepcounter.c b/non_catalog_apps/step_counter/stepcounter.c index f9b6267bcbf..17097fa4f84 100644 --- a/non_catalog_apps/step_counter/stepcounter.c +++ b/non_catalog_apps/step_counter/stepcounter.c @@ -7,6 +7,7 @@ #include #include #include +#include #define TAG_MEMSIC "memsic_2125_app" #define TAG_COUNTER "step_counter_app" @@ -95,6 +96,9 @@ static void render_callback(Canvas* canvas, void* ctx) { int32_t step_counter_app(void* p) { UNUSED(p); + Expansion* expansion = furi_record_open(RECORD_EXPANSION); + expansion_disable(expansion); + StepCounterContext* stepContext = malloc(sizeof(StepCounterContext)); stepContext->data = malloc(sizeof(StepCounterData)); stepContext->data->pin = gpio_accelerometer; @@ -152,5 +156,8 @@ int32_t step_counter_app(void* p) { free(stepContext->data); free(stepContext); + expansion_enable(expansion); + furi_record_close(RECORD_EXPANSION); + return 0; } diff --git a/non_catalog_apps/wiegand/wiegand.c b/non_catalog_apps/wiegand/wiegand.c index 6da4bab50c9..b3d126b234d 100644 --- a/non_catalog_apps/wiegand/wiegand.c +++ b/non_catalog_apps/wiegand/wiegand.c @@ -1,4 +1,5 @@ #include "wiegand.h" +#include const GpioPin* const pinD0 = &gpio_ext_pa4; const GpioPin* const pinD0mosfet = &gpio_ext_pb3; @@ -112,6 +113,10 @@ void app_free(void* context) { int wiegand_app(void* p) { UNUSED(p); + + Expansion* expansion = furi_record_open(RECORD_EXPANSION); + expansion_disable(expansion); + App* app = app_alloc(); Gui* gui = furi_record_open(RECORD_GUI); @@ -120,5 +125,8 @@ int wiegand_app(void* p) { view_dispatcher_run(app->view_dispatcher); app_free(app); + + expansion_enable(expansion); + furi_record_close(RECORD_EXPANSION); return 0; } \ No newline at end of file