diff --git a/applications/app-loader/app-loader.c b/applications/app-loader/app-loader.c index 5b3b9d61..b942e500 100644 --- a/applications/app-loader/app-loader.c +++ b/applications/app-loader/app-loader.c @@ -91,29 +91,7 @@ int32_t app_loader(void* p) { } }); - with_value_mutex( - menu_mutex, (Menu * menu) { - menu_item_add( - menu, menu_item_alloc_function("U2F", assets_icons_get(A_U2F_14), NULL, NULL)); - menu_item_add( - menu, - menu_item_alloc_function( - "File Manager", assets_icons_get(A_FileManager_14), NULL, NULL)); - menu_item_add( - menu, menu_item_alloc_function("Games", assets_icons_get(A_Games_14), NULL, NULL)); - menu_item_add( - menu, - menu_item_alloc_function( - "Passport", - assets_icons_get(A_Passport_14), - app_loader_menu_callback, - (void*)&FLIPPER_SCENE_APPS[0])); - menu_item_add( - menu, - menu_item_alloc_function("Settings", assets_icons_get(A_Settings_14), NULL, NULL)); - }); - - // plugins + // Plugins with_value_mutex( menu_mutex, (Menu * menu) { MenuItem* menu_plugins = @@ -143,6 +121,37 @@ int32_t app_loader(void* p) { menu_item_add(menu, menu_plugins); }); +#ifdef APP_DEBUG + with_value_mutex( + menu_mutex, (Menu * menu) { + MenuItem* menu_debug = + menu_item_alloc_menu("Debug tools", assets_icons_get(A_Settings_14)); + + for(size_t i = 0; i < FLIPPER_DEBUG_APPS_COUNT; i++) { + // Add menu item + menu_item_subitem_add( + menu_debug, + menu_item_alloc_function( + FLIPPER_DEBUG_APPS[i].name, + assets_icons_get(FLIPPER_DEBUG_APPS[i].icon), + app_loader_menu_callback, + (void*)&FLIPPER_DEBUG_APPS[i])); + + // Add cli command + string_t cli_name; + string_init_set_str(cli_name, "app_"); + string_cat_str(cli_name, FLIPPER_DEBUG_APPS[i].name); + cli_add_command( + state.cli, + string_get_cstr(cli_name), + app_loader_cli_callback, + (void*)&FLIPPER_DEBUG_APPS[i]); + string_clear(cli_name); + } + + menu_item_add(menu, menu_debug); + }); +#endif printf("[app loader] start\r\n"); diff --git a/applications/applications.c b/applications/applications.c index 04e09118..c8a02965 100644 --- a/applications/applications.c +++ b/applications/applications.c @@ -180,12 +180,13 @@ const size_t FLIPPER_APPS_COUNT = sizeof(FLIPPER_APPS) / sizeof(FlipperApplicati // Plugin menu const FlipperApplication FLIPPER_PLUGINS[] = { -#ifdef BUILD_EXAMPLE_BLINK - {.app = application_blink, .name = "blink", .stack_size = 1024, .icon = A_Plugins_14}, + +#ifdef BUILD_MUSIC_PLAYER + {.app = music_player, .name = "music player", .stack_size = 1024, .icon = A_Plugins_14}, #endif -#ifdef BUILD_EXAMPLE_INPUT_DUMP - {.app = application_input_dump, .name = "input dump", .stack_size = 1024, .icon = A_Plugins_14}, +#ifdef BUILD_FLOOPPER_BLOOPPER + {.app = floopper_bloopper, .name = "Floopper Bloopper", .stack_size = 1024, .icon = A_Games_14}, #endif #ifdef BUILD_SPEAKER_DEMO @@ -195,6 +196,20 @@ const FlipperApplication FLIPPER_PLUGINS[] = { .icon = A_Plugins_14}, #endif +}; + +const size_t FLIPPER_PLUGINS_COUNT = sizeof(FLIPPER_PLUGINS) / sizeof(FlipperApplication); + +// Plugin menu +const FlipperApplication FLIPPER_DEBUG_APPS[] = { +#ifdef BUILD_EXAMPLE_BLINK + {.app = application_blink, .name = "blink", .stack_size = 1024, .icon = A_Plugins_14}, +#endif + +#ifdef BUILD_EXAMPLE_INPUT_DUMP + {.app = application_input_dump, .name = "input dump", .stack_size = 1024, .icon = A_Plugins_14}, +#endif + #ifdef BUILD_SD_TEST {.app = sd_card_test, .name = "sd_card_test", .stack_size = 4096, .icon = A_Plugins_14}, #endif @@ -203,14 +218,6 @@ const FlipperApplication FLIPPER_PLUGINS[] = { {.app = application_vibro, .name = "vibro", .stack_size = 1024, .icon = A_Plugins_14}, #endif -#ifdef BUILD_MUSIC_PLAYER - {.app = music_player, .name = "music player", .stack_size = 1024, .icon = A_Plugins_14}, -#endif - -#ifdef BUILD_FLOOPPER_BLOOPPER - {.app = floopper_bloopper, .name = "Floopper Bloopper", .stack_size = 1024, .icon = A_Games_14}, -#endif - #ifdef BUILD_SDNFC {.app = sdnfc, .name = "sdnfc", .stack_size = 1024, .icon = A_Plugins_14}, #endif @@ -225,8 +232,9 @@ const FlipperApplication FLIPPER_PLUGINS[] = { }; -const size_t FLIPPER_PLUGINS_COUNT = sizeof(FLIPPER_PLUGINS) / sizeof(FlipperApplication); +const size_t FLIPPER_DEBUG_APPS_COUNT = sizeof(FLIPPER_DEBUG_APPS) / sizeof(FlipperApplication); +#ifdef APP_DOLPHIN const FlipperApplication FLIPPER_SCENE = {.app = scene_app, .name = "Scenes", .stack_size = 1024, .icon = A_Games_14}; @@ -237,3 +245,5 @@ const FlipperApplication FLIPPER_SCENE_APPS[] = { }; const size_t FLIPPER_SCENE_APPS_COUNT = sizeof(FLIPPER_SCENE_APPS) / sizeof(FlipperApplication); + +#endif diff --git a/applications/applications.h b/applications/applications.h index 98f9373f..6d636376 100644 --- a/applications/applications.h +++ b/applications/applications.h @@ -28,6 +28,12 @@ extern const size_t FLIPPER_APPS_COUNT; extern const FlipperApplication FLIPPER_PLUGINS[]; extern const size_t FLIPPER_PLUGINS_COUNT; +/* Debug menu apps + * Spawned by app-loader + */ +extern const FlipperApplication FLIPPER_DEBUG_APPS[]; +extern const size_t FLIPPER_DEBUG_APPS_COUNT; + /* Seperate scene app holder * Spawned by app-loader */ diff --git a/applications/applications.mk b/applications/applications.mk index b1667098..57999d2b 100644 --- a/applications/applications.mk +++ b/applications/applications.mk @@ -19,22 +19,29 @@ APP_CLI = 1 APP_SD_FILESYSTEM = 1 BUILD_IRDA = 1 APP_DOLPHIN = 1 -BUILD_EXAMPLE_BLINK = 1 -BUILD_EXAMPLE_UART_WRITE = 1 -BUILD_EXAMPLE_INPUT_DUMP = 1 BUILD_SUBGHZ = 1 BUILD_LF_RFID = 1 -BUILD_SPEAKER_DEMO = 1 -BUILD_VIBRO_DEMO = 1 -BUILD_SD_TEST = 1 BUILD_GPIO_DEMO = 1 BUILD_MUSIC_PLAYER = 1 BUILD_FLOOPPER_BLOOPPER = 1 BUILD_IBUTTON = 1 +endif + +APP_DEBUG ?=0 +ifeq ($(APP_DEBUG), 1) +CFLAGS += -DAPP_DEBUG BUILD_GUI_TEST = 1 BUILD_KEYPAD_TEST = 1 +BUILD_SD_TEST = 1 +BUILD_VIBRO_DEMO = 1 +BUILD_SPEAKER_DEMO = 1 +BUILD_EXAMPLE_BLINK = 1 +BUILD_EXAMPLE_UART_WRITE = 1 +BUILD_EXAMPLE_INPUT_DUMP = 1 endif + + APP_NFC ?= 0 ifeq ($(APP_NFC), 1) APP_MENU = 1 diff --git a/applications/power/power.c b/applications/power/power.c index 35a9488c..cd417be4 100644 --- a/applications/power/power.c +++ b/applications/power/power.c @@ -102,7 +102,7 @@ Power* power_alloc() { power->cli = furi_record_open("cli"); power_cli_init(power->cli); - power->menu = menu_item_alloc_menu("Power", NULL); + power->menu = menu_item_alloc_menu("Power", assets_icons_get(A_Power_14)); menu_item_subitem_add( power->menu, menu_item_alloc_function("Off", NULL, power_menu_off_callback, power)); menu_item_subitem_add( diff --git a/assets/icons/MainMenu/Power_14/frame_01.png b/assets/icons/MainMenu/Power_14/frame_01.png new file mode 100644 index 00000000..382d7132 Binary files /dev/null and b/assets/icons/MainMenu/Power_14/frame_01.png differ diff --git a/assets/icons/MainMenu/Power_14/frame_rate b/assets/icons/MainMenu/Power_14/frame_rate new file mode 100644 index 00000000..e440e5c8 --- /dev/null +++ b/assets/icons/MainMenu/Power_14/frame_rate @@ -0,0 +1 @@ +3 \ No newline at end of file diff --git a/flash_core1_main.sh b/flash_core1_main.sh index 613bd6ba..3fad80e0 100755 --- a/flash_core1_main.sh +++ b/flash_core1_main.sh @@ -6,4 +6,4 @@ rm bootloader/.obj/f*/flash || true make -C bootloader -j9 flash rm firmware/.obj/f*/flash || true -make -C firmware -j9 APP_RELEASE=1 flash +make -C firmware -j9 APP_RELEASE=1 APP_DEBUG=1 flash