Make settings menus external -21.7kb DFU

This commit is contained in:
Willy-JL
2024-02-14 04:36:48 +00:00
parent 1b91ec95c3
commit acc352e61f
29 changed files with 99 additions and 22 deletions
+1 -1
View File
@@ -62,7 +62,7 @@ extern const FlipperInternalApplication FLIPPER_ARCHIVE;
/* Settings list
* Spawned by loader
*/
extern const FlipperInternalApplication FLIPPER_SETTINGS_APPS[];
extern const FlipperExternalApplication FLIPPER_SETTINGS_APPS[];
extern const size_t FLIPPER_SETTINGS_APPS_COUNT;
/* External Menu Apps list
+1 -1
View File
@@ -14,7 +14,7 @@ App(
],
stack_size=1 * 1024,
order=1000,
sdk_headers=["bt_service/bt.h"],
sdk_headers=["bt_service/bt.h", "bt_settings.h"],
)
App(
@@ -14,4 +14,5 @@ App(
conflicts=["updater"],
stack_size=2 * 1024,
order=60,
sdk_headers=["desktop_settings.h"],
)
@@ -53,6 +53,10 @@ typedef struct {
typedef Keybind Keybinds[KeybindTypeCount][KeybindKeyCount];
#ifdef __cplusplus
extern "C" {
#endif
bool DESKTOP_SETTINGS_SAVE(DesktopSettings* x);
bool DESKTOP_SETTINGS_LOAD(DesktopSettings* x);
@@ -60,3 +64,7 @@ bool DESKTOP_SETTINGS_LOAD(DesktopSettings* x);
bool DESKTOP_KEYBINDS_SAVE(Keybinds* x, size_t size);
bool DESKTOP_KEYBINDS_LOAD(Keybinds* x, size_t size);
#ifdef __cplusplus
}
#endif
@@ -5,6 +5,8 @@ App(
cdefines=["SRV_EXPANSION"],
sdk_headers=[
"expansion.h",
"expansion_i.h",
"expansion_settings.h",
],
requires=["rpc_start"],
provides=["expansion_settings"],
@@ -3,4 +3,12 @@
#include "expansion_settings.h"
#include "expansion.h"
#ifdef __cplusplus
extern "C" {
#endif
ExpansionSettings* expansion_get_settings(Expansion* instance);
#ifdef __cplusplus
}
#endif
+6 -1
View File
@@ -26,6 +26,12 @@ static const char* loader_find_external_application_by_name(const char* app_name
}
}
for(size_t i = 0; i < FLIPPER_SETTINGS_APPS_COUNT; i++) {
if(strcmp(FLIPPER_SETTINGS_APPS[i].name, app_name) == 0) {
return FLIPPER_SETTINGS_APPS[i].path;
}
}
return NULL;
}
@@ -321,7 +327,6 @@ static const FlipperInternalApplication* loader_find_application_by_name(const c
const uint32_t count;
} lists[] = {
{FLIPPER_APPS, FLIPPER_APPS_COUNT},
{FLIPPER_SETTINGS_APPS, FLIPPER_SETTINGS_APPS_COUNT},
{FLIPPER_SYSTEM_APPS, FLIPPER_SYSTEM_APPS_COUNT},
{FLIPPER_DEBUG_APPS, FLIPPER_DEBUG_APPS_COUNT},
};
@@ -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"],
)
@@ -59,4 +59,12 @@ struct NotificationApp {
NotificationSettings settings;
};
#ifdef __cplusplus
extern "C" {
#endif
void notification_message_save_settings(NotificationApp* app);
#ifdef __cplusplus
}
#endif
+1 -1
View File
@@ -14,7 +14,7 @@ App(
],
stack_size=1 * 1024,
order=110,
sdk_headers=["power_service/power.h"],
sdk_headers=["power_service/power.h", "power_settings.h"],
)
App(
@@ -7,6 +7,14 @@
#define POWER_SETTINGS_PATH CFG_PATH("power.settings")
#define POWER_SETTINGS_MAGIC (0x21)
#ifdef __cplusplus
extern "C" {
#endif
bool SAVE_POWER_SETTINGS(uint32_t* x);
bool LOAD_POWER_SETTINGS(uint32_t* x);
#ifdef __cplusplus
}
#endif
@@ -10,4 +10,5 @@ App(
],
stack_size=1 * 1024,
order=1000,
fap_category="assets",
)
@@ -9,4 +9,5 @@ App(
"gui",
],
order=10,
fap_category="assets",
)
@@ -9,4 +9,5 @@ App(
],
stack_size=1 * 1024,
order=50,
fap_category="assets",
)
@@ -0,0 +1 @@
#include <applications/services/desktop/helpers/pin.c>
@@ -0,0 +1 @@
#include <applications/services/desktop/views/desktop_view_pin_input.c>
@@ -10,4 +10,5 @@ App(
],
stack_size=1 * 1024,
order=60,
fap_category="assets",
)
@@ -6,4 +6,5 @@ App(
requires=["gui"],
stack_size=1 * 1024,
order=80,
fap_category="assets",
)
@@ -6,4 +6,5 @@ App(
requires=["notification"],
stack_size=1 * 1024,
order=20,
fap_category="assets",
)
@@ -0,0 +1 @@
#include <applications/settings/about/about.c>
@@ -11,4 +11,5 @@ App(
flags=["InsomniaSafe"],
stack_size=1 * 1024,
order=40,
fap_category="assets",
)
@@ -1,5 +1,5 @@
#include "power_settings_app.h"
#include "../about/about.h"
#include <applications/settings/about/about.h>
static bool power_settings_custom_event_callback(void* context, uint32_t event) {
furi_assert(context);
@@ -6,4 +6,5 @@ App(
requires=["storage"],
stack_size=2 * 1024,
order=30,
fap_category="assets",
)
@@ -6,4 +6,5 @@ App(
requires=["gui", "locale"],
stack_size=1 * 1024,
order=70,
fap_category="assets",
)
+1 -1
View File
@@ -248,7 +248,6 @@ class AppBuildset:
FlipperAppType.APP,
FlipperAppType.DEBUG,
FlipperAppType.ARCHIVE,
FlipperAppType.SETTINGS,
FlipperAppType.STARTUP,
)
EXTERNAL_APP_TYPES_MAP = {
@@ -257,6 +256,7 @@ class AppBuildset:
FlipperAppType.PLUGIN: True,
FlipperAppType.DEBUG: True,
FlipperAppType.MENUEXTERNAL: False,
FlipperAppType.SETTINGS: False,
}
@classmethod
+19 -14
View File
@@ -23,20 +23,22 @@ class ApplicationsCGenerator:
FlipperAppType.SYSTEM: ("FlipperInternalApplication", "FLIPPER_SYSTEM_APPS"),
FlipperAppType.APP: ("FlipperInternalApplication", "FLIPPER_APPS"),
FlipperAppType.DEBUG: ("FlipperInternalApplication", "FLIPPER_DEBUG_APPS"),
FlipperAppType.SETTINGS: (
"FlipperInternalApplication",
"FLIPPER_SETTINGS_APPS",
),
FlipperAppType.STARTUP: (
"FlipperInternalOnStartHook",
"FLIPPER_ON_SYSTEM_START",
),
}
APP_EXTERNAL_TYPE = (
"FlipperExternalApplication",
"FLIPPER_EXTERNAL_APPS",
)
EXTERNAL_TYPE_MAP = {
FlipperAppType.MENUEXTERNAL: (
"FlipperExternalApplication",
"FLIPPER_EXTERNAL_APPS",
),
FlipperAppType.SETTINGS: (
"FlipperExternalApplication",
"FLIPPER_SETTINGS_APPS",
),
}
def __init__(self, buildset: AppBuildset, autorun_app: str = ""):
self.buildset = buildset
@@ -100,12 +102,15 @@ class ApplicationsCGenerator:
]
)
entry_type, entry_block = self.APP_EXTERNAL_TYPE
external_apps = self.buildset.get_apps_of_type(FlipperAppType.MENUEXTERNAL)
contents.append(f"const {entry_type} {entry_block}[] = {{")
contents.append(",\n".join(map(self.get_external_app_descr, external_apps)))
contents.append("};")
contents.append(f"const size_t {entry_block}_COUNT = COUNT_OF({entry_block});")
for apptype in self.EXTERNAL_TYPE_MAP:
entry_type, entry_block = self.EXTERNAL_TYPE_MAP[apptype]
external_apps = self.buildset.get_apps_of_type(apptype)
contents.append(f"const {entry_type} {entry_block}[] = {{")
contents.append(",\n".join(map(self.get_external_app_descr, external_apps)))
contents.append("};")
contents.append(
f"const size_t {entry_block}_COUNT = COUNT_OF({entry_block});"
)
return "\n".join(contents)
+1
View File
@@ -488,6 +488,7 @@ def _gather_app_components(env, appname) -> AppDeploymentComponents:
if host_app.apptype in [
FlipperAppType.EXTERNAL,
FlipperAppType.MENUEXTERNAL,
FlipperAppType.SETTINGS,
]:
components.add_app(host_app)
else:
+1
View File
@@ -232,6 +232,7 @@ apps_to_build_as_faps = [
FlipperAppType.PLUGIN,
FlipperAppType.EXTERNAL,
FlipperAppType.MENUEXTERNAL,
FlipperAppType.SETTINGS,
]
known_extapps = [
+19 -1
View File
@@ -5,12 +5,16 @@ Header,+,applications/main/archive/helpers/archive_helpers_ext.h,,
Header,+,applications/main/subghz/subghz_fap.h,,
Header,+,applications/services/applications.h,,
Header,+,applications/services/bt/bt_service/bt.h,,
Header,+,applications/services/bt/bt_settings.h,,
Header,+,applications/services/cli/cli.h,,
Header,+,applications/services/cli/cli_vcp.h,,
Header,+,applications/services/desktop/desktop_settings.h,,
Header,+,applications/services/dialogs/dialogs.h,,
Header,+,applications/services/dolphin/dolphin.h,,
Header,+,applications/services/dolphin/helpers/dolphin_state.h,,
Header,+,applications/services/expansion/expansion.h,,
Header,+,applications/services/expansion/expansion_i.h,,
Header,+,applications/services/expansion/expansion_settings.h,,
Header,+,applications/services/gui/elements.h,,
Header,+,applications/services/gui/gui.h,,
Header,+,applications/services/gui/icon_i.h,,
@@ -38,8 +42,10 @@ Header,+,applications/services/loader/firmware_api/firmware_api.h,,
Header,+,applications/services/loader/loader.h,,
Header,+,applications/services/locale/locale.h,,
Header,+,applications/services/notification/notification.h,,
Header,+,applications/services/notification/notification_app.h,,
Header,+,applications/services/notification/notification_messages.h,,
Header,+,applications/services/power/power_service/power.h,,
Header,+,applications/services/power/power_settings.h,,
Header,+,applications/services/rpc/rpc_app.h,,
Header,+,applications/services/storage/storage.h,,
Header,+,build/icons/assets_icons.h,,
@@ -291,6 +297,10 @@ Header,+,targets/furi_hal_include/furi_hal_usb_hid.h,,
Header,+,targets/furi_hal_include/furi_hal_usb_hid_u2f.h,,
Header,+,targets/furi_hal_include/furi_hal_version.h,,
Header,+,targets/furi_hal_include/furi_hal_vibro.h,,
Function,+,DESKTOP_KEYBINDS_LOAD,_Bool,"Keybinds*, size_t"
Function,+,DESKTOP_KEYBINDS_SAVE,_Bool,"Keybinds*, size_t"
Function,-,DESKTOP_SETTINGS_LOAD,_Bool,DesktopSettings*
Function,+,DESKTOP_SETTINGS_SAVE,_Bool,DesktopSettings*
Function,-,LL_ADC_CommonDeInit,ErrorStatus,ADC_Common_TypeDef*
Function,-,LL_ADC_CommonInit,ErrorStatus,"ADC_Common_TypeDef*, const LL_ADC_CommonInitTypeDef*"
Function,-,LL_ADC_CommonStructInit,void,LL_ADC_CommonInitTypeDef*
@@ -388,6 +398,8 @@ Function,-,LL_USART_DeInit,ErrorStatus,const USART_TypeDef*
Function,+,LL_USART_Init,ErrorStatus,"USART_TypeDef*, const LL_USART_InitTypeDef*"
Function,-,LL_USART_StructInit,void,LL_USART_InitTypeDef*
Function,-,LL_mDelay,void,uint32_t
Function,+,LOAD_POWER_SETTINGS,_Bool,uint32_t*
Function,+,SAVE_POWER_SETTINGS,_Bool,uint32_t*
Function,-,SK6805_get_led_count,uint8_t,
Function,-,SK6805_init,void,
Function,-,SK6805_set_led_color,void,"uint8_t, uint8_t, uint8_t, uint8_t"
@@ -714,6 +726,8 @@ Function,+,bt_set_profile_adv_name,void,"Bt*, const char*, ..."
Function,+,bt_set_profile_mac_address,void,"Bt*, const uint8_t[6]"
Function,+,bt_set_profile_pairing_method,void,"Bt*, GapPairing"
Function,+,bt_set_status_changed_callback,void,"Bt*, BtStatusChangedCallback, void*"
Function,-,bt_settings_load,_Bool,BtSettings*
Function,+,bt_settings_save,_Bool,BtSettings*
Function,+,buffered_file_stream_alloc,Stream*,Storage*
Function,+,buffered_file_stream_close,_Bool,Stream*
Function,+,buffered_file_stream_get_error,FS_Error,Stream*
@@ -955,7 +969,10 @@ Function,-,exp2f,float,float
Function,-,exp2l,long double,long double
Function,+,expansion_disable,void,Expansion*
Function,+,expansion_enable,void,Expansion*
Function,+,expansion_get_settings,ExpansionSettings*,Expansion*
Function,+,expansion_set_listen_serial,void,"Expansion*, FuriHalSerialId"
Function,-,expansion_settings_load,_Bool,ExpansionSettings*
Function,+,expansion_settings_save,_Bool,ExpansionSettings*
Function,-,expf,float,float
Function,-,expl,long double,long double
Function,-,explicit_bzero,void,"void*, size_t"
@@ -2727,6 +2744,7 @@ Function,+,notification_internal_message,void,"NotificationApp*, const Notificat
Function,+,notification_internal_message_block,void,"NotificationApp*, const NotificationSequence*"
Function,+,notification_message,void,"NotificationApp*, const NotificationSequence*"
Function,+,notification_message_block,void,"NotificationApp*, const NotificationSequence*"
Function,+,notification_message_save_settings,void,NotificationApp*
Function,-,nrand48,long,unsigned short[3]
Function,-,on_exit,int,"void (*)(int, void*), void*"
Function,+,onewire_host_alloc,OneWireHost*,const GpioPin*
@@ -3646,7 +3664,7 @@ Variable,-,FLIPPER_ON_SYSTEM_START,const FlipperInternalOnStartHook[],
Variable,-,FLIPPER_ON_SYSTEM_START_COUNT,const size_t,
Variable,-,FLIPPER_SERVICES,const FlipperInternalApplication[],
Variable,-,FLIPPER_SERVICES_COUNT,const size_t,
Variable,+,FLIPPER_SETTINGS_APPS,const FlipperInternalApplication[],
Variable,+,FLIPPER_SETTINGS_APPS,const FlipperExternalApplication[],
Variable,+,FLIPPER_SETTINGS_APPS_COUNT,const size_t,
Variable,-,FLIPPER_SYSTEM_APPS,const FlipperInternalApplication[],
Variable,-,FLIPPER_SYSTEM_APPS_COUNT,const size_t,
1 entry status name type params
5 Header + applications/main/subghz/subghz_fap.h
6 Header + applications/services/applications.h
7 Header + applications/services/bt/bt_service/bt.h
8 Header + applications/services/bt/bt_settings.h
9 Header + applications/services/cli/cli.h
10 Header + applications/services/cli/cli_vcp.h
11 Header + applications/services/desktop/desktop_settings.h
12 Header + applications/services/dialogs/dialogs.h
13 Header + applications/services/dolphin/dolphin.h
14 Header + applications/services/dolphin/helpers/dolphin_state.h
15 Header + applications/services/expansion/expansion.h
16 Header + applications/services/expansion/expansion_i.h
17 Header + applications/services/expansion/expansion_settings.h
18 Header + applications/services/gui/elements.h
19 Header + applications/services/gui/gui.h
20 Header + applications/services/gui/icon_i.h
42 Header + applications/services/loader/loader.h
43 Header + applications/services/locale/locale.h
44 Header + applications/services/notification/notification.h
45 Header + applications/services/notification/notification_app.h
46 Header + applications/services/notification/notification_messages.h
47 Header + applications/services/power/power_service/power.h
48 Header + applications/services/power/power_settings.h
49 Header + applications/services/rpc/rpc_app.h
50 Header + applications/services/storage/storage.h
51 Header + build/icons/assets_icons.h
297 Header + targets/furi_hal_include/furi_hal_usb_hid_u2f.h
298 Header + targets/furi_hal_include/furi_hal_version.h
299 Header + targets/furi_hal_include/furi_hal_vibro.h
300 Function + DESKTOP_KEYBINDS_LOAD _Bool Keybinds*, size_t
301 Function + DESKTOP_KEYBINDS_SAVE _Bool Keybinds*, size_t
302 Function - DESKTOP_SETTINGS_LOAD _Bool DesktopSettings*
303 Function + DESKTOP_SETTINGS_SAVE _Bool DesktopSettings*
304 Function - LL_ADC_CommonDeInit ErrorStatus ADC_Common_TypeDef*
305 Function - LL_ADC_CommonInit ErrorStatus ADC_Common_TypeDef*, const LL_ADC_CommonInitTypeDef*
306 Function - LL_ADC_CommonStructInit void LL_ADC_CommonInitTypeDef*
398 Function + LL_USART_Init ErrorStatus USART_TypeDef*, const LL_USART_InitTypeDef*
399 Function - LL_USART_StructInit void LL_USART_InitTypeDef*
400 Function - LL_mDelay void uint32_t
401 Function + LOAD_POWER_SETTINGS _Bool uint32_t*
402 Function + SAVE_POWER_SETTINGS _Bool uint32_t*
403 Function - SK6805_get_led_count uint8_t
404 Function - SK6805_init void
405 Function - SK6805_set_led_color void uint8_t, uint8_t, uint8_t, uint8_t
726 Function + bt_set_profile_mac_address void Bt*, const uint8_t[6]
727 Function + bt_set_profile_pairing_method void Bt*, GapPairing
728 Function + bt_set_status_changed_callback void Bt*, BtStatusChangedCallback, void*
729 Function - bt_settings_load _Bool BtSettings*
730 Function + bt_settings_save _Bool BtSettings*
731 Function + buffered_file_stream_alloc Stream* Storage*
732 Function + buffered_file_stream_close _Bool Stream*
733 Function + buffered_file_stream_get_error FS_Error Stream*
969 Function - exp2l long double long double
970 Function + expansion_disable void Expansion*
971 Function + expansion_enable void Expansion*
972 Function + expansion_get_settings ExpansionSettings* Expansion*
973 Function + expansion_set_listen_serial void Expansion*, FuriHalSerialId
974 Function - expansion_settings_load _Bool ExpansionSettings*
975 Function + expansion_settings_save _Bool ExpansionSettings*
976 Function - expf float float
977 Function - expl long double long double
978 Function - explicit_bzero void void*, size_t
2744 Function + notification_internal_message_block void NotificationApp*, const NotificationSequence*
2745 Function + notification_message void NotificationApp*, const NotificationSequence*
2746 Function + notification_message_block void NotificationApp*, const NotificationSequence*
2747 Function + notification_message_save_settings void NotificationApp*
2748 Function - nrand48 long unsigned short[3]
2749 Function - on_exit int void (*)(int, void*), void*
2750 Function + onewire_host_alloc OneWireHost* const GpioPin*
3664 Variable - FLIPPER_ON_SYSTEM_START_COUNT const size_t
3665 Variable - FLIPPER_SERVICES const FlipperInternalApplication[]
3666 Variable - FLIPPER_SERVICES_COUNT const size_t
3667 Variable + FLIPPER_SETTINGS_APPS const FlipperInternalApplication[] const FlipperExternalApplication[]
3668 Variable + FLIPPER_SETTINGS_APPS_COUNT const size_t
3669 Variable - FLIPPER_SYSTEM_APPS const FlipperInternalApplication[]
3670 Variable - FLIPPER_SYSTEM_APPS_COUNT const size_t