moving non critical settings to sd

based on WillyJL's work

TODO: fix loader_menu
This commit is contained in:
MX
2026-01-11 09:30:28 +03:00
parent c407fd2d1a
commit 2db115783c
33 changed files with 3103 additions and 34 deletions

View File

@@ -65,6 +65,12 @@ extern const FlipperInternalApplication FLIPPER_ARCHIVE;
extern const FlipperInternalApplication FLIPPER_SETTINGS_APPS[];
extern const size_t FLIPPER_SETTINGS_APPS_COUNT;
/* External Settings list
* Spawned by loader
*/
extern const FlipperExternalApplication FLIPPER_EXTSETTINGS_APPS[];
extern const size_t FLIPPER_EXTSETTINGS_APPS_COUNT;
/* External Menu Apps list
* Spawned by loader
*/

View File

@@ -14,7 +14,12 @@ App(
],
stack_size=1 * 1024,
order=20,
sdk_headers=["bt_service/bt.h", "bt_service/bt_keys_storage.h"],
sdk_headers=[
"bt_service/bt.h",
"bt_service/bt_keys_storage.h",
"bt_settings.h",
"bt_service/bt_settings_api_i.h",
],
)
App(

View File

@@ -3,6 +3,14 @@
#include "bt.h"
#include "../bt_settings.h"
#ifdef __cplusplus
extern "C" {
#endif
void bt_get_settings(Bt* bt, BtSettings* settings);
void bt_set_settings(Bt* bt, const BtSettings* settings);
#ifdef __cplusplus
}
#endif

View File

@@ -14,4 +14,5 @@ App(
conflicts=["updater"],
stack_size=2 * 1024,
order=60,
sdk_headers=["desktop_settings.h", "desktop.h"],
)

View File

@@ -6,6 +6,10 @@
#define RECORD_DESKTOP "desktop"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct Desktop Desktop;
typedef struct {
@@ -21,3 +25,7 @@ FuriPubSub* desktop_api_get_status_pubsub(Desktop* instance);
void desktop_api_get_settings(Desktop* instance, DesktopSettings* settings);
void desktop_api_set_settings(Desktop* instance, const DesktopSettings* settings);
#ifdef __cplusplus
}
#endif

View File

@@ -9,6 +9,10 @@
#define DISPLAY_BATTERY_RETRO_5 4
#define DISPLAY_BATTERY_BAR_PERCENT 5
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
FavoriteAppLeftShort,
FavoriteAppLeftLong,
@@ -49,3 +53,7 @@ typedef struct {
void desktop_settings_load(DesktopSettings* settings);
void desktop_settings_save(const DesktopSettings* settings);
#ifdef __cplusplus
}
#endif

View File

@@ -3,7 +3,7 @@
#include <stdbool.h>
#include <core/pubsub.h>
#include "helpers/dolphin_deed.h"
#include "helpers/dolphin_state.h"
#ifdef __cplusplus
extern "C" {

View File

@@ -5,6 +5,10 @@
#include "dolphin_deed.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
DolphinFlagHappyMode = 1,
} DolphinFlags;
@@ -50,3 +54,7 @@ bool dolphin_state_is_levelup(uint32_t icounter);
void dolphin_state_increase_level(DolphinState* dolphin_state);
uint8_t dolphin_get_level(uint32_t icounter);
#ifdef __cplusplus
}
#endif

View File

@@ -5,6 +5,7 @@ App(
cdefines=["SRV_EXPANSION"],
sdk_headers=[
"expansion.h",
"expansion_settings.h",
],
requires=["rpc_start"],
provides=["expansion_settings"],

View File

@@ -23,6 +23,12 @@ static const char* loader_find_external_application_by_name(const char* app_name
}
}
for(size_t i = 0; i < FLIPPER_EXTSETTINGS_APPS_COUNT; i++) {
if(strcmp(FLIPPER_EXTSETTINGS_APPS[i].name, app_name) == 0) {
return FLIPPER_EXTSETTINGS_APPS[i].path;
}
}
return NULL;
}

View File

@@ -25,10 +25,14 @@ static void loader_cli_list(void) {
for(size_t i = 0; i < FLIPPER_APPS_COUNT; i++) {
printf("\t%s\r\n", FLIPPER_APPS[i].name);
}
printf("Settings:\r\n");
printf("Int Settings:\r\n");
for(size_t i = 0; i < FLIPPER_SETTINGS_APPS_COUNT; i++) {
printf("\t%s\r\n", FLIPPER_SETTINGS_APPS[i].name);
}
printf("Ext Settings:\r\n");
for(size_t i = 0; i < FLIPPER_EXTSETTINGS_APPS_COUNT; i++) {
printf("\t%s\r\n", FLIPPER_EXTSETTINGS_APPS[i].name);
}
}
static void loader_cli_info(Loader* loader) {

View File

@@ -76,11 +76,9 @@ static void
loader_menu_settings_menu_callback(void* context, InputType input_type, uint32_t index) {
UNUSED(context);
if(input_type == InputTypeShort) {
const char* name = FLIPPER_SETTINGS_APPS[index].name;
loader_menu_start(name);
loader_menu_start((const char*)index);
} else if(input_type == InputTypeLong) {
const char* name = FLIPPER_SETTINGS_APPS[index].name;
archive_favorites_handle_setting_pin_unpin(name, NULL);
archive_favorites_handle_setting_pin_unpin((const char*)index, NULL);
}
}
@@ -140,7 +138,15 @@ static void loader_menu_build_submenu(LoaderMenuApp* app, LoaderMenu* loader_men
submenu_add_item_ex(
app->settings_menu,
FLIPPER_SETTINGS_APPS[i].name,
i,
(uint32_t)FLIPPER_SETTINGS_APPS[i].name,
loader_menu_settings_menu_callback,
loader_menu);
}
for(size_t i = 0; i < FLIPPER_EXTSETTINGS_APPS_COUNT; i++) {
submenu_add_item_ex(
app->settings_menu,
FLIPPER_EXTSETTINGS_APPS[i].name,
(uint32_t)FLIPPER_EXTSETTINGS_APPS[i].name,
loader_menu_settings_menu_callback,
loader_menu);
}

View File

@@ -8,5 +8,5 @@ App(
provides=["notification_settings"],
stack_size=int(1.5 * 1024),
order=100,
sdk_headers=["notification.h", "notification_messages.h"],
sdk_headers=["notification.h", "notification_messages.h", "notification_app.h"],
)

View File

@@ -9,6 +9,10 @@
#define NOTIFICATION_LED_COUNT 3
#define NOTIFICATION_EVENT_COMPLETE 0x00000001U
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
NotificationLayerMessage,
InternalLayerMessage,
@@ -102,3 +106,7 @@ void rainbow_timer_starter(NotificationApp* app);
const char* rgb_backlight_get_color_text(uint8_t index);
uint8_t rgb_backlight_get_color_count(void);
void set_rgb_backlight_installed_variable(uint8_t var);
#ifdef __cplusplus
}
#endif