From 66a705022176af8faf7dada882fff4551aa302bc Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Sat, 12 Apr 2025 03:03:50 +0300 Subject: [PATCH] free up some ram for now, use settings user --- .../resources/subghz/assets/setting_user.example | 13 +++++++++++++ applications/main/subghz/subghz.c | 7 ++++--- lib/subghz/subghz_setting.c | 1 + 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/applications/main/subghz/resources/subghz/assets/setting_user.example b/applications/main/subghz/resources/subghz/assets/setting_user.example index 5034659be..9f74ee379 100644 --- a/applications/main/subghz/resources/subghz/assets/setting_user.example +++ b/applications/main/subghz/resources/subghz/assets/setting_user.example @@ -20,6 +20,19 @@ Version: 1 # Custom preset # format for CC1101 "Custom_preset_data:" XX YY XX YY .. 00 00 ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ, where: XX-register, YY - register data, 00 00 - end load register, ZZ - 8 byte Pa table register +#Custom_preset_name: FM95 +#Custom_preset_module: CC1101 +#Custom_preset_data: 02 0D 0B 06 08 32 07 04 14 00 13 02 12 04 11 83 10 67 15 24 18 18 19 16 1D 91 1C 00 1B 07 20 FB 22 10 21 56 00 00 C0 00 00 00 00 00 00 00 + +#2-FSK 200khz BW / 135kHz Filter/ 15.86Khz Deviation + Ramping +#Custom_preset_name: FM15k +#Custom_preset_module: CC1101 +#Custom_preset_data: 02 0D 03 47 08 32 0B 06 15 32 14 00 13 00 12 00 11 32 10 A7 18 18 19 1D 1D 92 1C 00 1B 04 20 FB 22 17 21 B6 00 00 00 12 0E 34 60 C5 C1 C0 + +#Custom_preset_name: Pagers +#Custom_preset_module: CC1101 +#Custom_preset_data: 02 0D 07 04 08 32 0B 06 10 64 11 93 12 0C 13 02 14 00 15 15 18 18 19 16 1B 07 1C 00 1D 91 20 FB 21 56 22 10 00 00 C0 00 00 00 00 00 00 00 + #Custom_preset_name: AM_1 #Custom_preset_module: CC1101 #Custom_preset_data: 02 0D 03 07 08 32 0B 06 14 00 13 00 12 30 11 32 10 17 18 18 19 18 1D 91 1C 00 1B 07 20 FB 22 11 21 B6 00 00 00 C0 00 00 00 00 00 00 diff --git a/applications/main/subghz/subghz.c b/applications/main/subghz/subghz.c index cb4fc5504..d07eff2b3 100644 --- a/applications/main/subghz/subghz.c +++ b/applications/main/subghz/subghz.c @@ -56,11 +56,11 @@ static void subghz_rpc_command_callback(const RpcAppSystemEvent* event, void* co rpc_system_app_confirm(subghz->rpc_ctx, false); } } - +/* static void subghz_load_custom_presets(SubGhzSetting* setting) { furi_assert(setting); - const char* presets[][2] = { + const char* presets[3][2] = { {"FM95", "02 0D 0B 06 08 32 07 04 14 00 13 02 12 04 11 83 10 67 15 24 18 18 19 16 1D 91 1C 00 1B 07 20 FB 22 10 21 56 00 00 C0 00 00 00 00 00 00 00"}, @@ -88,6 +88,7 @@ static void subghz_load_custom_presets(SubGhzSetting* setting) { subghz_setting_customs_presets_to_log(setting); #endif } +*/ SubGhz* subghz_alloc(bool alloc_for_tx_only) { SubGhz* subghz = malloc(sizeof(SubGhz)); @@ -194,7 +195,7 @@ SubGhz* subghz_alloc(bool alloc_for_tx_only) { SubGhzSetting* setting = subghz_txrx_get_setting(subghz->txrx); - subghz_load_custom_presets(setting); + //subghz_load_custom_presets(setting); // Load last used values for Read, Read RAW, etc. or default subghz->last_settings = subghz_last_settings_alloc(); diff --git a/lib/subghz/subghz_setting.c b/lib/subghz/subghz_setting.c index 2ee02c7f9..ab8c77910 100644 --- a/lib/subghz/subghz_setting.c +++ b/lib/subghz/subghz_setting.c @@ -296,6 +296,7 @@ void subghz_setting_load(SubGhzSetting* instance, const char* file_path) { FURI_LOG_E(TAG, "Rewind error"); break; } + furi_string_reset(temp_str); while(flipper_format_read_string(fff_data_file, "Custom_preset_name", temp_str)) { FURI_LOG_I(TAG, "Custom preset loaded %s", furi_string_get_cstr(temp_str)); subghz_setting_load_custom_preset(