From 566ba378ff8abd8cb588a9d5231459def150b968 Mon Sep 17 00:00:00 2001 From: aanper Date: Sat, 17 Oct 2020 11:48:52 +0300 Subject: [PATCH] add apploader example --- applications/app-loader/app-loader.c | 18 ++++++++++++++++++ applications/applications.mk | 1 + applications/startup.h | 2 ++ core/flipper.h | 2 ++ core/flipper_v2.h | 2 ++ 5 files changed, 25 insertions(+) create mode 100644 applications/app-loader/app-loader.c diff --git a/applications/app-loader/app-loader.c b/applications/app-loader/app-loader.c new file mode 100644 index 00000000..e15787af --- /dev/null +++ b/applications/app-loader/app-loader.c @@ -0,0 +1,18 @@ +#include "flipper.h" + +/* +render_loader + +handle_input + +handle_menu +*/ + +void app_loader(void* p) { + osThreadId_t self_id = osThreadGetId(); + assert(self_id); + + printf("[app loader] start\n"); + + osThreadSuspend(self_id); +} \ No newline at end of file diff --git a/applications/applications.mk b/applications/applications.mk index 188a2abe..3b4c4f9a 100644 --- a/applications/applications.mk +++ b/applications/applications.mk @@ -16,6 +16,7 @@ APP_INPUT = 1 APP_GUI = 1 CFLAGS += -DAPP_MENU C_SOURCES += $(wildcard $(APP_DIR)/menu/*.c) +C_SOURCES += $(wildcard $(APP_DIR)/app-loader/*.c) endif APP_TEST ?= 0 diff --git a/applications/startup.h b/applications/startup.h index 847009dc..342a2234 100644 --- a/applications/startup.h +++ b/applications/startup.h @@ -27,6 +27,7 @@ void u8g2_qrcode(void* p); void fatfs_list(void* p); void gui_task(void* p); void backlight_control(void* p); +void app_loader(void* p); const FlipperStartupApp FLIPPER_STARTUP[] = { #ifdef APP_DISPLAY @@ -44,6 +45,7 @@ const FlipperStartupApp FLIPPER_STARTUP[] = { #ifdef APP_MENU {.app = menu_task, .name = "menu_task", .libs = {1, FURI_LIB{"gui_task"}}}, + {.app = app_loader, .name = "app_loader", .libs = {1, FURI_LIB{"menu_task"}}}, #endif // {.app = coreglitch_demo_0, .name = "coreglitch_demo_0", .libs = ""}, diff --git a/core/flipper.h b/core/flipper.h index 8e4cd098..890f0d25 100644 --- a/core/flipper.h +++ b/core/flipper.h @@ -16,6 +16,8 @@ extern "C" { } #endif +#include + // Arduino defines #define pinMode app_gpio_init diff --git a/core/flipper_v2.h b/core/flipper_v2.h index 9e3bc90e..6d3fa47f 100644 --- a/core/flipper_v2.h +++ b/core/flipper_v2.h @@ -1,5 +1,7 @@ #pragma once +#include "flipper.h" + #include "api-basic/furi.h" //#include "api-basic/flapp.h" #include "cmsis_os2.h"