mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-06-07 19:01:54 -07:00
Merge branch 'UNLEASHED' into 420
This commit is contained in:
@@ -1,62 +0,0 @@
|
||||
name: 'Unit tests'
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
TARGETS: f7
|
||||
DEFAULT_TARGET: f7
|
||||
|
||||
jobs:
|
||||
run_units_on_test_bench:
|
||||
runs-on: [self-hosted, FlipperZeroTest]
|
||||
steps:
|
||||
- name: 'Decontaminate previous build leftovers'
|
||||
run: |
|
||||
if [ -d .git ]; then
|
||||
git submodule status || git checkout "$(git rev-list --max-parents=0 HEAD | tail -n 1)"
|
||||
fi
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
|
||||
- name: 'Get flipper from device manager (mock)'
|
||||
id: device
|
||||
run: |
|
||||
echo "flipper=/dev/ttyACM0" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: 'Flash unit tests firmware'
|
||||
id: flashing
|
||||
run: |
|
||||
FBT_TOOLCHAIN_PATH=/opt ./fbt flash OPENOCD_ADAPTER_SERIAL=2A0906016415303030303032 FIRMWARE_APP_SET=unit_tests FORCE=1
|
||||
|
||||
- name: 'Wait for flipper to finish updating'
|
||||
id: connect
|
||||
if: steps.flashing.outcome == 'success'
|
||||
run: |
|
||||
. scripts/toolchain/fbtenv.sh
|
||||
./scripts/testing/await_flipper.py ${{steps.device.outputs.flipper}}
|
||||
|
||||
- name: 'Format flipper SD card'
|
||||
id: format
|
||||
if: steps.connect.outcome == 'success'
|
||||
run: |
|
||||
. scripts/toolchain/fbtenv.sh
|
||||
./scripts/storage.py -p ${{steps.device.outputs.flipper}} format_ext
|
||||
|
||||
- name: 'Copy assets and unit tests data to flipper'
|
||||
id: copy
|
||||
if: steps.format.outcome == 'success'
|
||||
run: |
|
||||
. scripts/toolchain/fbtenv.sh
|
||||
./scripts/storage.py -p ${{steps.device.outputs.flipper}} send assets/resources /ext
|
||||
./scripts/storage.py -p ${{steps.device.outputs.flipper}} send assets/unit_tests /ext/unit_tests
|
||||
|
||||
- name: 'Run units and validate results'
|
||||
if: steps.copy.outcome == 'success'
|
||||
run: |
|
||||
. scripts/toolchain/fbtenv.sh
|
||||
./scripts/testing/units.py ${{steps.device.outputs.flipper}}
|
||||
+10
-17
@@ -1,21 +1,11 @@
|
||||
### New changes
|
||||
* API: Version was changed due to breaking changes - from 8.x to 10.x - Extra pack was updated, download it by using link below ([- Download latest extra apps pack](https://download-directory.github.io/?url=https://github.com/xMasterX/unleashed-extra-pack/tree/main/apps))
|
||||
* SubGHz: Improve signals visibility in history
|
||||
* Infrared: Update universal remote assets **(TV universal remote now works much faster)** (by @Amec0e)
|
||||
* Plugins: Weather Station -> Improved signal info dashboard, added signal age counter. (PR by @LY2NEO | #197) (Modified and improved by @xMasterX, new icons and UI changes recommendations by @Karator in OFW PR 2087)
|
||||
* Plugins: Weather Station -> Oregon2 - add support for RTHN129
|
||||
* Plugins: iButton Fuzzer -> change minimal delay (after @Tobirg successfully verified stability with lower delay)
|
||||
* Plugins: iButton Fuzzer + RFID Fuzzer -> Attempt to fix crash when exiting from uids from file attack
|
||||
* OFW: NFC bug fixes **(breaking change, affects API version)**
|
||||
* OFW: UART echo: fix race conditions causing null pointer dereference
|
||||
* OFW: File browser base folder **(breaking change, affects API version)**
|
||||
* OFW: Change NFC emulation screens
|
||||
* OFW: SubGhz: add RPC error
|
||||
* OFW: FuriHal, Power, UnitTests: battery charging voltage limit API
|
||||
* OFW: Fix logical error in storage script
|
||||
* OFW: VCP session close fix
|
||||
* OFW: Dolphin: new animation L2_Wake_up_128x64
|
||||
* OFW: FuriHal: add i2c unit tests
|
||||
* SubGHz: app launch times improved significantly, also setting_user file no longer overwritten by firmware updates, this update will remove this file (only this version, next ones will not touch it (if you skip this version file will be removed in any case on next update)), be sure to backup if you have custom changes in it!
|
||||
Now this file is actually should be created by user and will be not removed every update!
|
||||
* Plugins: Add POCSAG Pager [(by xMasterX & Shmuma)](https://github.com/xMasterX/flipper-pager)
|
||||
* Misc fixes
|
||||
* OFW: IR button overflow fix
|
||||
* OFW: Weather Station: proper event flow for view redraw.
|
||||
* OFW: Untangle NFC from Unit Tests
|
||||
|
||||
#### [🎲 Download latest extra apps pack](https://download-directory.github.io/?url=https://github.com/xMasterX/unleashed-extra-pack/tree/main/apps)
|
||||
|
||||
@@ -24,6 +14,7 @@
|
||||
[-> Download qFlipper (official link)](https://flipperzero.one/update)
|
||||
|
||||
## Please support development of the project
|
||||
* Boosty: https://boosty.to/mmxdev
|
||||
* destream (100 EUR min): https://destream.net/live/MMX/donate
|
||||
* cloudtips (only RU payments accepted): https://pay.cloudtips.ru/p/7b3e9d65
|
||||
* YooMoney (only RU payments accepted): https://yoomoney.ru/fundraise/XA49mgQLPA0.221209
|
||||
@@ -40,6 +31,8 @@
|
||||
|
||||
**Recommended option - Web Updater**
|
||||
|
||||
What means `n` in - `flipper-z-f7-update-(version)n.tgz` ? - that means this build comes without our custom animations, only official flipper animations
|
||||
|
||||
Self-update package (update from microSD) - `flipper-z-f7-update-(version).zip` or download `.tgz` for mobile app / qFlipper
|
||||
|
||||
|
||||
|
||||
@@ -38,11 +38,6 @@ InfraredBruteForce* infrared_brute_force_alloc() {
|
||||
return brute_force;
|
||||
}
|
||||
|
||||
void infrared_brute_force_clear_records(InfraredBruteForce* brute_force) {
|
||||
furi_assert(!brute_force->is_started);
|
||||
InfraredBruteForceRecordDict_reset(brute_force->records);
|
||||
}
|
||||
|
||||
void infrared_brute_force_free(InfraredBruteForce* brute_force) {
|
||||
furi_assert(!brute_force->is_started);
|
||||
InfraredBruteForceRecordDict_clear(brute_force->records);
|
||||
|
||||
@@ -16,7 +16,7 @@ bool infrared_brute_force_start(
|
||||
bool infrared_brute_force_is_started(InfraredBruteForce* brute_force);
|
||||
void infrared_brute_force_stop(InfraredBruteForce* brute_force);
|
||||
bool infrared_brute_force_send_next(InfraredBruteForce* brute_force);
|
||||
void infrared_brute_force_clear_records(InfraredBruteForce* brute_force);
|
||||
void infrared_brute_force_reset(InfraredBruteForce* brute_force);
|
||||
void infrared_brute_force_add_record(
|
||||
InfraredBruteForce* brute_force,
|
||||
uint32_t index,
|
||||
|
||||
@@ -87,6 +87,6 @@ void infrared_scene_universal_common_on_exit(void* context) {
|
||||
Infrared* infrared = context;
|
||||
ButtonPanel* button_panel = infrared->button_panel;
|
||||
view_stack_remove_view(infrared->view_stack, button_panel_get_view(button_panel));
|
||||
infrared_brute_force_clear_records(infrared->brute_force);
|
||||
infrared_brute_force_reset(infrared->brute_force);
|
||||
button_panel_reset(button_panel);
|
||||
}
|
||||
|
||||
@@ -188,6 +188,54 @@ SubGhz* subghz_alloc(bool alloc_for_tx_only) {
|
||||
subghz_setting_load(subghz->setting, EXT_PATH("subghz/assets/setting_user.txt"), true);
|
||||
}
|
||||
|
||||
subghz_setting_load(subghz->setting, EXT_PATH("subghz/assets/setting_user"));
|
||||
|
||||
// Custom Presets load without using config file
|
||||
|
||||
FlipperFormat* temp_fm_preset = flipper_format_string_alloc();
|
||||
flipper_format_write_string_cstr(
|
||||
temp_fm_preset,
|
||||
(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 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");
|
||||
flipper_format_rewind(temp_fm_preset);
|
||||
subghz_setting_load_custom_preset(subghz->setting, (const char*)"FM95", temp_fm_preset);
|
||||
|
||||
flipper_format_free(temp_fm_preset);
|
||||
|
||||
// #2-FSK 200khz BW / 135kHz Filter/ 15.86Khz Deviation + Ramping
|
||||
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 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");
|
||||
flipper_format_rewind(temp_fm_preset2);
|
||||
subghz_setting_load_custom_preset(subghz->setting, (const char*)"FM15k", temp_fm_preset2);
|
||||
|
||||
flipper_format_free(temp_fm_preset2);
|
||||
|
||||
// # HND - FM presets
|
||||
FlipperFormat* temp_fm_preset3 = flipper_format_string_alloc();
|
||||
flipper_format_write_string_cstr(
|
||||
temp_fm_preset3,
|
||||
(const char*)"Custom_preset_data",
|
||||
(const char*)"02 0D 0B 06 08 32 07 04 14 00 13 02 12 04 11 36 10 69 15 32 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_preset3);
|
||||
subghz_setting_load_custom_preset(subghz->setting, (const char*)"HND_1", temp_fm_preset3);
|
||||
|
||||
flipper_format_free(temp_fm_preset3);
|
||||
|
||||
FlipperFormat* temp_fm_preset4 = flipper_format_string_alloc();
|
||||
flipper_format_write_string_cstr(
|
||||
temp_fm_preset4,
|
||||
(const char*)"Custom_preset_data",
|
||||
(const char*)"02 0D 0B 06 08 32 07 04 14 00 13 02 12 07 11 36 10 E9 15 32 18 18 19 16 1D 92 1C 40 1B 03 20 FB 22 10 21 56 00 00 C0 00 00 00 00 00 00 00");
|
||||
flipper_format_rewind(temp_fm_preset4);
|
||||
subghz_setting_load_custom_preset(subghz->setting, (const char*)"HND_2", temp_fm_preset4);
|
||||
|
||||
flipper_format_free(temp_fm_preset4);
|
||||
|
||||
// custom presets loading - end
|
||||
|
||||
// Load last used values for Read, Read RAW, etc. or default
|
||||
if(!alloc_for_tx_only) {
|
||||
subghz->last_settings = subghz_last_settings_alloc();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -81,7 +81,7 @@ WeatherStationApp* weather_station_app_alloc() {
|
||||
app->setting = subghz_setting_alloc();
|
||||
|
||||
//ToDo FIX file name setting
|
||||
subghz_setting_load(app->setting, EXT_PATH("subghz/assets/setting_user"), true);
|
||||
subghz_setting_load(app->setting, EXT_PATH("subghz/assets/setting_user"));
|
||||
|
||||
//init Worker & Protocol & History
|
||||
app->lock = WSLockOff;
|
||||
|
||||
@@ -453,7 +453,7 @@ static void
|
||||
} while(false);
|
||||
|
||||
furi_string_free(remote_path);
|
||||
infrared_brute_force_clear_records(brute_force);
|
||||
infrared_brute_force_reset(brute_force);
|
||||
infrared_brute_force_free(brute_force);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
# for adding manufacture keys
|
||||
# AABBCCDDEEFFAABB:X:NAME\r\n
|
||||
# AABBCCDDEEFFAABB - man 64 bit
|
||||
# X - encryption method 1 - Simple Learning, 2 - Normal_Learning, 3 - Secure_Learning, 4 - Magic_xor_type1 Learning, 5 - FAAC, 6 - Magic Serial typ1
|
||||
# X - encryption method - 1 - Simple Learning, 2 - Normal_Learning, 3 - Secure_Learning,
|
||||
# 4 - Magic_xor_type1 Learning, 5 - FAAC SLH,
|
||||
# 6 - Magic Serial typ1, 7 - Magic Serial typ2, 8 - Magic Serial typ3
|
||||
# 0 - iterates over both previous and man in direct and reverse byte sequence
|
||||
# NAME - name (string without spaces) max 64 characters long
|
||||
Filetype: Flipper SubGhz Keystore File
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
# to use manual settings and prevent them from being deleted on upgrade, rename *_user.example files to *_user
|
||||
Filetype: Flipper SubGhz Setting File
|
||||
Version: 1
|
||||
# Add Standard frequencies for your region
|
||||
#Add_standard_frequencies: true
|
||||
|
||||
# Default Frequency: used as default for "Read" and "Read Raw"
|
||||
#Default_frequency: 433920000
|
||||
|
||||
# Frequencies used for "Read", "Read Raw" and "Frequency Analyzer"
|
||||
#Frequency: 300000000
|
||||
#Frequency: 310000000
|
||||
#Frequency: 320000000
|
||||
|
||||
# Frequencies used for hopping mode (keep this list small or flipper will miss signal)
|
||||
#Hopper_frequency: 300000000
|
||||
#Hopper_frequency: 310000000
|
||||
#Hopper_frequency: 310000000
|
||||
|
||||
# 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: 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
|
||||
|
||||
#Custom_preset_name: AM_2
|
||||
#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
|
||||
@@ -3106,7 +3106,7 @@ Function,+,subghz_setting_get_preset_data,uint8_t*,"SubGhzSetting*, size_t"
|
||||
Function,+,subghz_setting_get_preset_data_by_name,uint8_t*,"SubGhzSetting*, const char*"
|
||||
Function,+,subghz_setting_get_preset_data_size,size_t,"SubGhzSetting*, size_t"
|
||||
Function,+,subghz_setting_get_preset_name,const char*,"SubGhzSetting*, size_t"
|
||||
Function,+,subghz_setting_load,void,"SubGhzSetting*, const char*, _Bool"
|
||||
Function,+,subghz_setting_load,void,"SubGhzSetting*, const char*"
|
||||
Function,+,subghz_setting_load_custom_preset,_Bool,"SubGhzSetting*, const char*, FlipperFormat*"
|
||||
Function,+,subghz_setting_set_default_frequency,void,"SubGhzSetting*, uint32_t"
|
||||
Function,+,subghz_transmitter_alloc_init,SubGhzTransmitter*,"SubGhzEnvironment*, const char*"
|
||||
|
||||
|
+86
-56
@@ -18,26 +18,59 @@
|
||||
static const uint32_t subghz_frequency_list[] = {
|
||||
/* 300 - 348 */
|
||||
300000000,
|
||||
302757000,
|
||||
303875000,
|
||||
304250000,
|
||||
307000000,
|
||||
307500000,
|
||||
307800000,
|
||||
309000000,
|
||||
310000000,
|
||||
312000000,
|
||||
312100000,
|
||||
312200000,
|
||||
313000000,
|
||||
313850000,
|
||||
314000000,
|
||||
314350000,
|
||||
314980000,
|
||||
315000000,
|
||||
318000000,
|
||||
330000000,
|
||||
345000000,
|
||||
348000000,
|
||||
|
||||
/* 387 - 464 */
|
||||
387000000,
|
||||
390000000,
|
||||
418000000,
|
||||
433075000, /* LPD433 first */
|
||||
433220000,
|
||||
433420000,
|
||||
433657070,
|
||||
433889000,
|
||||
433920000 | FREQUENCY_FLAG_DEFAULT, /* LPD433 mid */
|
||||
434075000,
|
||||
434176948,
|
||||
434190000,
|
||||
434390000,
|
||||
434420000,
|
||||
434620000,
|
||||
434775000, /* LPD433 last channels */
|
||||
438900000,
|
||||
440175000,
|
||||
464000000,
|
||||
|
||||
/* 779 - 928 */
|
||||
779000000,
|
||||
868350000,
|
||||
868400000,
|
||||
868800000,
|
||||
868950000,
|
||||
906400000,
|
||||
915000000,
|
||||
925000000,
|
||||
928000000,
|
||||
0,
|
||||
};
|
||||
|
||||
@@ -182,7 +215,7 @@ void subghz_setting_load_default(SubGhzSetting* instance) {
|
||||
instance, subghz_frequency_list, subghz_hopper_frequency_list);
|
||||
}
|
||||
|
||||
void subghz_setting_load(SubGhzSetting* instance, const char* file_path, bool not_skip_frequencies) {
|
||||
void subghz_setting_load(SubGhzSetting* instance, const char* file_path) {
|
||||
furi_assert(instance);
|
||||
|
||||
Storage* storage = furi_record_open(RECORD_STORAGE);
|
||||
@@ -215,67 +248,64 @@ void subghz_setting_load(SubGhzSetting* instance, const char* file_path, bool no
|
||||
}
|
||||
|
||||
// Standard frequencies (optional)
|
||||
if(not_skip_frequencies) {
|
||||
temp_bool = true;
|
||||
flipper_format_read_bool(fff_data_file, "Add_standard_frequencies", &temp_bool, 1);
|
||||
if(!temp_bool) {
|
||||
FURI_LOG_I(TAG, "Removing standard frequencies");
|
||||
FrequencyList_reset(instance->frequencies);
|
||||
FrequencyList_reset(instance->hopper_frequencies);
|
||||
temp_bool = true;
|
||||
flipper_format_read_bool(fff_data_file, "Add_standard_frequencies", &temp_bool, 1);
|
||||
if(!temp_bool) {
|
||||
FURI_LOG_I(TAG, "Removing standard frequencies");
|
||||
FrequencyList_reset(instance->frequencies);
|
||||
FrequencyList_reset(instance->hopper_frequencies);
|
||||
} else {
|
||||
FURI_LOG_I(TAG, "Keeping standard frequencies");
|
||||
}
|
||||
|
||||
// Load frequencies
|
||||
if(!flipper_format_rewind(fff_data_file)) {
|
||||
FURI_LOG_E(TAG, "Rewind error");
|
||||
break;
|
||||
}
|
||||
while(flipper_format_read_uint32(
|
||||
fff_data_file, "Frequency", (uint32_t*)&temp_data32, 1)) {
|
||||
if(furi_hal_subghz_is_frequency_valid(temp_data32)) {
|
||||
FURI_LOG_I(TAG, "Frequency loaded %lu", temp_data32);
|
||||
FrequencyList_push_back(instance->frequencies, temp_data32);
|
||||
} else {
|
||||
FURI_LOG_I(TAG, "Keeping standard frequencies");
|
||||
FURI_LOG_E(TAG, "Frequency not supported %lu", temp_data32);
|
||||
}
|
||||
}
|
||||
|
||||
// Load frequencies
|
||||
if(!flipper_format_rewind(fff_data_file)) {
|
||||
FURI_LOG_E(TAG, "Rewind error");
|
||||
break;
|
||||
}
|
||||
while(flipper_format_read_uint32(
|
||||
fff_data_file, "Frequency", (uint32_t*)&temp_data32, 1)) {
|
||||
if(furi_hal_subghz_is_frequency_valid(temp_data32)) {
|
||||
FURI_LOG_I(TAG, "Frequency loaded %lu", temp_data32);
|
||||
FrequencyList_push_back(instance->frequencies, temp_data32);
|
||||
} else {
|
||||
FURI_LOG_E(TAG, "Frequency not supported %lu", temp_data32);
|
||||
}
|
||||
// Load hopper frequencies
|
||||
if(!flipper_format_rewind(fff_data_file)) {
|
||||
FURI_LOG_E(TAG, "Rewind error");
|
||||
break;
|
||||
}
|
||||
while(flipper_format_read_uint32(
|
||||
fff_data_file, "Hopper_frequency", (uint32_t*)&temp_data32, 1)) {
|
||||
if(furi_hal_subghz_is_frequency_valid(temp_data32)) {
|
||||
FURI_LOG_I(TAG, "Hopper frequency loaded %lu", temp_data32);
|
||||
FrequencyList_push_back(instance->hopper_frequencies, temp_data32);
|
||||
} else {
|
||||
FURI_LOG_E(TAG, "Hopper frequency not supported %lu", temp_data32);
|
||||
}
|
||||
}
|
||||
|
||||
// Load hopper frequencies
|
||||
if(!flipper_format_rewind(fff_data_file)) {
|
||||
FURI_LOG_E(TAG, "Rewind error");
|
||||
break;
|
||||
}
|
||||
while(flipper_format_read_uint32(
|
||||
fff_data_file, "Hopper_frequency", (uint32_t*)&temp_data32, 1)) {
|
||||
if(furi_hal_subghz_is_frequency_valid(temp_data32)) {
|
||||
FURI_LOG_I(TAG, "Hopper frequency loaded %lu", temp_data32);
|
||||
FrequencyList_push_back(instance->hopper_frequencies, temp_data32);
|
||||
} else {
|
||||
FURI_LOG_E(TAG, "Hopper frequency not supported %lu", temp_data32);
|
||||
}
|
||||
}
|
||||
// Default frequency (optional)
|
||||
if(!flipper_format_rewind(fff_data_file)) {
|
||||
FURI_LOG_E(TAG, "Rewind error");
|
||||
break;
|
||||
}
|
||||
if(flipper_format_read_uint32(fff_data_file, "Default_frequency", &temp_data32, 1)) {
|
||||
subghz_setting_set_default_frequency(instance, temp_data32);
|
||||
}
|
||||
|
||||
// Default frequency (optional)
|
||||
if(!flipper_format_rewind(fff_data_file)) {
|
||||
FURI_LOG_E(TAG, "Rewind error");
|
||||
break;
|
||||
}
|
||||
if(flipper_format_read_uint32(
|
||||
fff_data_file, "Default_frequency", &temp_data32, 1)) {
|
||||
subghz_setting_set_default_frequency(instance, temp_data32);
|
||||
}
|
||||
|
||||
// custom preset (optional)
|
||||
if(!flipper_format_rewind(fff_data_file)) {
|
||||
FURI_LOG_E(TAG, "Rewind error");
|
||||
break;
|
||||
}
|
||||
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(
|
||||
instance, furi_string_get_cstr(temp_str), fff_data_file);
|
||||
}
|
||||
// custom preset (optional)
|
||||
if(!flipper_format_rewind(fff_data_file)) {
|
||||
FURI_LOG_E(TAG, "Rewind error");
|
||||
break;
|
||||
}
|
||||
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(
|
||||
instance, furi_string_get_cstr(temp_str), fff_data_file);
|
||||
}
|
||||
|
||||
} while(false);
|
||||
|
||||
@@ -18,7 +18,7 @@ SubGhzSetting* subghz_setting_alloc(void);
|
||||
|
||||
void subghz_setting_free(SubGhzSetting* instance);
|
||||
|
||||
void subghz_setting_load(SubGhzSetting* instance, const char* file_path, bool not_skip_frequencies);
|
||||
void subghz_setting_load(SubGhzSetting* instance, const char* file_path);
|
||||
|
||||
size_t subghz_setting_get_frequency_count(SubGhzSetting* instance);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user