Fix incompatibility with OFW in subghz part + improve speed

SubGHz app launch times improved, also setting_user file no longer added by firmware, this update will remove this file, be sure to backup!
Now this file is actually should be created by user and will be not removed every update!
This commit is contained in:
MX
2022-12-11 00:42:26 +03:00
parent 63b40992ef
commit 17ea9315e0
10 changed files with 173 additions and 185 deletions

View File

@@ -5,9 +5,6 @@
#include <lib/flipper_format/flipper_format.h>
#include "protocols/protocol_items.h"
// Comment next line to build on OFW
#define IS_UNLEASHED
static bool pocsag_pager_app_custom_event_callback(void* context, uint32_t event) {
furi_assert(context);
POCSAGPagerApp* app = context;
@@ -84,12 +81,10 @@ POCSAGPagerApp* pocsag_pager_app_alloc() {
//init setting
app->setting = subghz_setting_alloc();
//ToDo FIX file name setting
#ifdef IS_UNLEASHED
subghz_setting_load(app->setting, EXT_PATH("pocsag/settings.txt"), true);
#else
//ToDo FIX file name setting
subghz_setting_load(app->setting, EXT_PATH("pocsag/settings.txt"));
#endif
//init Worker & Protocol & History
app->lock = PCSGLockOff;
app->txrx = malloc(sizeof(POCSAGPagerTxRx));
@@ -108,16 +103,6 @@ POCSAGPagerApp* pocsag_pager_app_alloc() {
flipper_format_free(temp_fm_preset);
FlipperFormat* temp_fm_preset2 = flipper_format_string_alloc();
flipper_format_write_string_cstr(
temp_fm_preset2,
(const char*)"Custom_preset_data",
(const char*)"02 0D 0B 06 08 32 07 04 14 00 13 02 12 04 11 83 10 67 15 31 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");
flipper_format_rewind(temp_fm_preset2);
subghz_setting_load_custom_preset(app->setting, (const char*)"FM150", temp_fm_preset2);
flipper_format_free(temp_fm_preset2);
// custom presets loading - end
pcsg_preset_init(app, "FM95", 439987500, NULL, 0);