mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-06-07 19:01:54 -07:00
moving non critical settings to sd
based on WillyJL's work TODO: fix loader_menu
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -14,4 +14,5 @@ App(
|
||||
conflicts=["updater"],
|
||||
stack_size=2 * 1024,
|
||||
order=60,
|
||||
sdk_headers=["desktop_settings.h", "desktop.h"],
|
||||
)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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" {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -5,6 +5,7 @@ App(
|
||||
cdefines=["SRV_EXPANSION"],
|
||||
sdk_headers=[
|
||||
"expansion.h",
|
||||
"expansion_settings.h",
|
||||
],
|
||||
requires=["rpc_start"],
|
||||
provides=["expansion_settings"],
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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"],
|
||||
)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
App(
|
||||
appid="about",
|
||||
name="About",
|
||||
apptype=FlipperAppType.SETTINGS,
|
||||
apptype=FlipperAppType.EXTSETTINGS,
|
||||
entry_point="about_settings_app",
|
||||
cdefines=["APP_ABOUT"],
|
||||
requires=[
|
||||
@@ -10,4 +10,6 @@ App(
|
||||
],
|
||||
stack_size=1 * 1024,
|
||||
order=1000,
|
||||
fap_libs=["assets"],
|
||||
fap_category="assets",
|
||||
)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
App(
|
||||
appid="bt_settings",
|
||||
name="Bluetooth",
|
||||
apptype=FlipperAppType.SETTINGS,
|
||||
apptype=FlipperAppType.EXTSETTINGS,
|
||||
entry_point="bt_settings_app",
|
||||
stack_size=1 * 1024,
|
||||
requires=[
|
||||
@@ -9,4 +9,6 @@ App(
|
||||
"gui",
|
||||
],
|
||||
order=10,
|
||||
fap_libs=["assets"],
|
||||
fap_category="assets",
|
||||
)
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
App(
|
||||
appid="clock_settings",
|
||||
name="Clock & Alarm",
|
||||
apptype=FlipperAppType.SETTINGS,
|
||||
apptype=FlipperAppType.EXTSETTINGS,
|
||||
entry_point="clock_settings",
|
||||
requires=["gui"],
|
||||
provides=["clock_settings_start"],
|
||||
stack_size=1 * 1024,
|
||||
order=90,
|
||||
fap_libs=["assets"],
|
||||
fap_category="assets",
|
||||
)
|
||||
|
||||
App(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
App(
|
||||
appid="desktop_settings",
|
||||
name="Desktop",
|
||||
apptype=FlipperAppType.SETTINGS,
|
||||
apptype=FlipperAppType.EXTSETTINGS,
|
||||
entry_point="desktop_settings_app",
|
||||
requires=[
|
||||
"desktop",
|
||||
@@ -9,4 +9,6 @@ App(
|
||||
],
|
||||
stack_size=1 * 1024,
|
||||
order=50,
|
||||
fap_libs=["assets"],
|
||||
fap_category="assets",
|
||||
)
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
#include <applications/services/desktop/helpers/pin_code.c>
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "../desktop_settings_app.h"
|
||||
#include "applications.h"
|
||||
#include <applications.h>
|
||||
#include "desktop_settings_scene.h"
|
||||
#include "desktop_settings_scene_i.h"
|
||||
#include <flipper_application/flipper_application.h>
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
#include <applications/services/desktop/views/desktop_view_pin_input.c>
|
||||
@@ -1,7 +1,7 @@
|
||||
App(
|
||||
appid="passport",
|
||||
name="Passport",
|
||||
apptype=FlipperAppType.SETTINGS,
|
||||
apptype=FlipperAppType.EXTSETTINGS,
|
||||
entry_point="passport_app",
|
||||
cdefines=["APP_PASSPORT"],
|
||||
requires=[
|
||||
@@ -10,4 +10,6 @@ App(
|
||||
],
|
||||
stack_size=1 * 1024,
|
||||
order=60,
|
||||
fap_libs=["assets"],
|
||||
fap_category="assets",
|
||||
)
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
App(
|
||||
appid="expansion_settings",
|
||||
name="Expansion Modules",
|
||||
apptype=FlipperAppType.SETTINGS,
|
||||
apptype=FlipperAppType.EXTSETTINGS,
|
||||
entry_point="expansion_settings_app",
|
||||
requires=["gui"],
|
||||
stack_size=1 * 1024,
|
||||
order=80,
|
||||
fap_libs=["assets"],
|
||||
fap_category="assets",
|
||||
)
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
App(
|
||||
appid="input_settings",
|
||||
name="Input",
|
||||
apptype=FlipperAppType.SETTINGS,
|
||||
apptype=FlipperAppType.EXTSETTINGS,
|
||||
entry_point="input_settings_app",
|
||||
requires=["input"],
|
||||
stack_size=1 * 1024,
|
||||
order=100,
|
||||
fap_libs=["assets"],
|
||||
fap_category="assets",
|
||||
)
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
App(
|
||||
appid="notification_settings",
|
||||
name="LCD and Notifications",
|
||||
apptype=FlipperAppType.SETTINGS,
|
||||
apptype=FlipperAppType.EXTSETTINGS,
|
||||
entry_point="notification_settings_app",
|
||||
requires=["notification"],
|
||||
stack_size=1 * 1024,
|
||||
order=20,
|
||||
fap_libs=["assets"],
|
||||
fap_category="assets",
|
||||
)
|
||||
|
||||
@@ -8,6 +8,9 @@ env.Append(
|
||||
# Ugly hack
|
||||
Dir("../assets/compiled"),
|
||||
],
|
||||
SDK_HEADERS=[
|
||||
File("../applications/services/applications.h"),
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,9 @@ env.Append(
|
||||
LINT_SOURCES=[
|
||||
Dir("."),
|
||||
],
|
||||
SDK_HEADERS=[
|
||||
File("u8g2_glue.h"),
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
#include "u8g2.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
uint8_t u8g2_gpio_and_delay_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ptr);
|
||||
|
||||
uint8_t u8x8_hw_spi_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ptr);
|
||||
@@ -18,3 +22,7 @@ void u8x8_d_st756x_init(u8x8_t* u8x8, uint8_t contrast, uint8_t regulation_ratio
|
||||
void u8x8_d_st756x_set_contrast(u8x8_t* u8x8, int8_t contrast_offset);
|
||||
|
||||
void u8x8_d_st756x_set_inversion(u8x8_t* u8x8, bool arg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -26,6 +26,7 @@ class FlipperAppType(Enum):
|
||||
STARTUP = "StartupHook"
|
||||
EXTERNAL = "External"
|
||||
MENUEXTERNAL = "MenuExternal"
|
||||
EXTSETTINGS = "ExtSettings"
|
||||
METAPACKAGE = "Package"
|
||||
PLUGIN = "Plugin"
|
||||
|
||||
@@ -260,6 +261,7 @@ class AppBuildset:
|
||||
FlipperAppType.PLUGIN: True,
|
||||
FlipperAppType.DEBUG: True,
|
||||
FlipperAppType.MENUEXTERNAL: False,
|
||||
FlipperAppType.EXTSETTINGS: False,
|
||||
}
|
||||
DIST_APP_TYPES = list(
|
||||
# Applications that are installed on SD card
|
||||
|
||||
@@ -33,10 +33,16 @@ class ApplicationsCGenerator:
|
||||
),
|
||||
}
|
||||
|
||||
APP_EXTERNAL_TYPE = (
|
||||
"FlipperExternalApplication",
|
||||
"FLIPPER_EXTERNAL_APPS",
|
||||
)
|
||||
EXTERNAL_TYPE_MAP = {
|
||||
FlipperAppType.MENUEXTERNAL: (
|
||||
"FlipperExternalApplication",
|
||||
"FLIPPER_EXTERNAL_APPS",
|
||||
),
|
||||
FlipperAppType.EXTSETTINGS: (
|
||||
"FlipperExternalApplication",
|
||||
"FLIPPER_EXTSETTINGS_APPS",
|
||||
),
|
||||
}
|
||||
|
||||
def __init__(self, buildset: AppBuildset, autorun_app: str = ""):
|
||||
self.buildset = buildset
|
||||
@@ -100,12 +106,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)
|
||||
|
||||
|
||||
@@ -456,6 +456,7 @@ def _gather_app_components(env, appname) -> AppDeploymentComponents:
|
||||
if host_app.apptype in [
|
||||
FlipperAppType.EXTERNAL,
|
||||
FlipperAppType.MENUEXTERNAL,
|
||||
FlipperAppType.EXTSETTINGS,
|
||||
]:
|
||||
components.add_app(host_app)
|
||||
else:
|
||||
|
||||
@@ -232,6 +232,7 @@ apps_to_build_as_faps = [
|
||||
FlipperAppType.PLUGIN,
|
||||
FlipperAppType.EXTERNAL,
|
||||
FlipperAppType.MENUEXTERNAL,
|
||||
FlipperAppType.EXTSETTINGS,
|
||||
]
|
||||
|
||||
known_extapps = [
|
||||
|
||||
+2961
-6
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user