Make all service memory structures OFW comaptible

This commit is contained in:
Willy-JL
2023-08-29 01:57:06 +02:00
parent d87d982b2b
commit d7aa3ea60f
15 changed files with 63 additions and 30 deletions

View File

@@ -55,6 +55,7 @@ struct AnimationManager {
FuriString* freezed_animation_name;
int32_t freezed_animation_time_left;
ViewStack* view_stack;
bool _dummy_mode; // Unused, kept for compatibility
};
static StorageAnimation*

View File

@@ -55,10 +55,10 @@ struct Desktop {
ViewStack* locked_view_stack;
DesktopSettings settings;
Keybind keybinds[KeybindTypeCount][KeybindKeyCount];
DesktopViewPinInput* pin_input_view;
ViewPort* lock_icon_viewport;
ViewPort* _dummy_mode_icon_viewport; // Unused, kept for compatibility
ViewPort* clock_viewport;
ViewPort* stealth_mode_icon_viewport;
@@ -80,6 +80,8 @@ struct Desktop {
bool time_format_12 : 1; // 1 - 12 hour, 0 - 24H
bool in_transition : 1;
Keybind keybinds[KeybindTypeCount][KeybindKeyCount];
};
Desktop* desktop_alloc();

View File

@@ -1,15 +1,22 @@
#pragma once
typedef enum {
// Events with _ are unused, kept for compatibility
DesktopMainEventLockWithPin,
DesktopMainEventOpenLockMenu,
DesktopMainEventOpenArchive,
_DesktopMainEventOpenFavoriteLeftShort,
_DesktopMainEventOpenFavoriteLeftLong,
_DesktopMainEventOpenFavoriteRightShort,
_DesktopMainEventOpenFavoriteRightLong,
DesktopMainEventOpenMenu,
DesktopMainEventOpenDebug,
DesktopMainEventOpenPowerOff,
DesktopMainEventLockKeypad,
DesktopMainEventLockWithPin,
DesktopLockedEventOpenPowerOff,
_DesktopDummyEventOpenLeft,
_DesktopDummyEventOpenDown,
_DesktopDummyEventOpenOk,
DesktopLockedEventUnlocked,
DesktopLockedEventUpdate,
DesktopLockedEventShowPinInput,
@@ -27,11 +34,9 @@ typedef enum {
DesktopDebugEventSaveState,
DesktopDebugEventExit,
DesktopLockMenuEventSettings,
DesktopLockMenuEventLock,
DesktopLockMenuEventLockPin,
DesktopLockMenuEventLockPinOff,
DesktopLockMenuEventXtreme,
_DesktopLockMenuEventDummyModeOn,
_DesktopLockMenuEventDummyModeOff,
DesktopLockMenuEventStealthModeOn,
DesktopLockMenuEventStealthModeOff,
@@ -46,4 +51,11 @@ typedef enum {
DesktopGlobalBeforeAppStarted,
DesktopGlobalAfterAppFinished,
DesktopGlobalAutoLock,
DesktopMainEventLockKeypad,
DesktopLockedEventOpenPowerOff,
DesktopLockMenuEventSettings,
DesktopLockMenuEventLock,
DesktopLockMenuEventLockPinOff,
DesktopLockMenuEventXtreme,
} DesktopEvent;

View File

@@ -14,21 +14,24 @@ typedef void (*DesktopLockMenuViewCallback)(DesktopEvent event, void* context);
struct DesktopLockMenuView {
View* view;
DesktopLockMenuViewCallback callback;
void* context;
NotificationApp* notification;
Bt* bt;
bool save_notification;
bool save_xtreme;
bool save_bt;
void* context;
};
typedef struct {
uint8_t idx;
bool _dummy_mode; // Unused, kept for compatibility
bool stealth_mode;
bool pin_is_set;
int pin_lock;
bool show_lock_menu;
DesktopLockMenuView* lock_menu;
bool stealth_mode;
} DesktopLockMenuViewModel;
void desktop_lock_menu_set_callback(

View File

@@ -13,6 +13,8 @@ struct DesktopMainView {
View* view;
DesktopMainViewCallback callback;
void* context;
TimerHandle_t _poweroff_timer; // Unused, kept for compatibility
bool _dummy_mode; // Unused, kept for compatibility
};
void desktop_main_set_callback(

View File

@@ -62,7 +62,6 @@ struct Gui {
FuriMutex* mutex;
// Layers and Canvas
uint16_t hide_statusbar_count;
bool lockdown;
bool direct_draw;
ViewPortArray_t layers[GuiLayerMAX];
@@ -74,6 +73,8 @@ struct Gui {
FuriPubSub* input_events;
uint8_t ongoing_input;
ViewPort* ongoing_input_view_port;
uint16_t hide_statusbar_count;
};
/** Find enabled ViewPort in ViewPortArray

View File

@@ -12,5 +12,6 @@ struct Icon {
const uint8_t frame_count;
const uint8_t frame_rate;
const uint8_t* const* frames;
Icon* original;
};

View File

@@ -14,6 +14,7 @@
struct Menu {
View* view;
FuriTimer* scroll_timer;
};
@@ -32,6 +33,7 @@ ARRAY_DEF(MenuItemArray, MenuItem, M_POD_OPLIST);
typedef struct {
MenuItemArray_t items;
size_t position;
size_t scroll_counter;
size_t vertical_offset;
} MenuModel;

View File

@@ -24,24 +24,24 @@ typedef struct {
const char* header;
char* text_buffer;
size_t text_buffer_size;
size_t minimum_length;
char extra_symbols[9];
bool clear_default_text;
bool cursor_select;
size_t cursor_pos;
TextInputCallback callback;
void* callback_context;
uint8_t selected_row;
uint8_t selected_column;
uint8_t selected_keyboard;
TextInputValidatorCallback validator_callback;
void* validator_callback_context;
FuriString* validator_text;
bool validator_message_visible;
size_t minimum_length;
char extra_symbols[9];
bool cursor_select;
size_t cursor_pos;
uint8_t selected_keyboard;
} TextInputModel;
static const uint8_t keyboard_origin_x = 1;

View File

@@ -12,9 +12,10 @@ struct VariableItem {
FuriString* current_value_text;
uint8_t values_count;
VariableItemChangeCallback change_callback;
void* context;
bool locked;
FuriString* locked_message;
void* context;
};
ARRAY_DEF(VariableItemArray, VariableItem, M_POD_OPLIST);
@@ -23,15 +24,17 @@ struct VariableItemList {
View* view;
VariableItemListEnterCallback callback;
void* context;
FuriTimer* scroll_timer;
FuriTimer* locked_timer;
};
typedef struct {
VariableItemArray_t items;
FuriString* header;
uint8_t position;
uint8_t window_position;
FuriString* header;
size_t scroll_counter;
bool locked_message_visible;
} VariableItemListModel;

View File

@@ -20,20 +20,22 @@ struct Loader {
LoaderMenu* loader_menu;
LoaderApplications* loader_applications;
LoaderAppData app;
MenuAppList_t menu_apps;
};
typedef enum {
LoaderMessageTypeStartByName,
LoaderMessageTypeStartByNameDetachedWithGuiError,
LoaderMessageTypeAppClosed,
LoaderMessageTypeShowMenu,
LoaderMessageTypeShowSettings,
LoaderMessageTypeMenuClosed,
LoaderMessageTypeApplicationsClosed,
LoaderMessageTypeLock,
LoaderMessageTypeUnlock,
LoaderMessageTypeIsLocked,
LoaderMessageTypeStartByNameDetachedWithGuiError,
LoaderMessageTypeShowSettings,
} LoaderMessageType;
typedef struct {

View File

@@ -38,7 +38,6 @@ typedef struct {
bool gauge_is_ok;
bool is_charging;
bool is_shutdown_requested;
bool is_charge_capped;
float current_charger;
float current_gauge;
@@ -56,6 +55,8 @@ typedef struct {
uint8_t charge;
uint8_t health;
bool is_charge_capped;
} PowerInfo;
/** Power off device

View File

@@ -32,11 +32,6 @@ struct Power {
Gui* gui;
NotificationApp* notification;
FuriPubSub* event_pubsub;
FuriPubSub* settings_events;
FuriPubSub* input_events_pubsub;
FuriPubSubSubscription* input_events_subscription;
FuriPubSubSubscription* app_start_stop_subscription;
FuriPubSubSubscription* settings_events_subscription;
PowerEvent event;
PowerState state;
@@ -47,10 +42,16 @@ struct Power {
uint8_t battery_level;
uint8_t power_off_timeout;
FuriMutex* api_mtx;
FuriPubSub* settings_events;
FuriPubSub* input_events_pubsub;
FuriPubSubSubscription* input_events_subscription;
FuriPubSubSubscription* app_start_stop_subscription;
FuriPubSubSubscription* settings_events_subscription;
uint32_t shutdown_idle_delay_ms;
FuriTimer* auto_shutdown_timer;
Loader* loader;
FuriMutex* api_mtx;
};
typedef enum {

View File

@@ -169,13 +169,14 @@ typedef struct {
typedef struct {
FS_Error (*const stat)(void* context, const char* path, FileInfo* fileinfo);
FS_Error (*const remove)(void* context, const char* path);
FS_Error (*const rename)(void* context, const char* old, const char* new);
FS_Error (*const mkdir)(void* context, const char* path);
FS_Error (*const fs_info)(
void* context,
const char* fs_path,
uint64_t* total_space,
uint64_t* free_space);
FS_Error (*const rename)(void* context, const char* old, const char* new);
} FS_Common_Api;
/** Full filesystem api structure */

View File

@@ -141,7 +141,6 @@ typedef enum {
StorageCommandCommonTimestamp,
StorageCommandCommonStat,
StorageCommandCommonRemove,
StorageCommandCommonRename,
StorageCommandCommonMkDir,
StorageCommandCommonFSInfo,
StorageCommandSDFormat,
@@ -149,6 +148,8 @@ typedef enum {
StorageCommandSDInfo,
StorageCommandSDStatus,
StorageCommandCommonResolvePath,
StorageCommandCommonRename,
} StorageCommand;
typedef struct {