Even more subghz merge

This commit is contained in:
Willy-JL
2023-07-14 00:28:17 +02:00
parent f03cac5bdb
commit 913af0baf3
8 changed files with 52 additions and 99 deletions

View File

@@ -11,7 +11,7 @@ App(
],
provides=[
"subghz_start",
"subghz_load_dangerous_settings",
"subghz_load_extended_settings",
],
icon="A_Sub1ghz_14",
stack_size=3 * 1024,
@@ -29,9 +29,9 @@ App(
)
App(
appid="subghz_load_dangerous_settings",
appid="subghz_load_extended_settings",
apptype=FlipperAppType.STARTUP,
entry_point="subghz_dangerous_freq",
entry_point="subghz_extended_freq",
requires=["storage", "subghz"],
order=650,
)

View File

@@ -1,23 +0,0 @@
#include <furi.h>
#include <furi_hal.h>
#include <firmware/targets/f7/furi_hal/furi_hal_subghz_i.h>
#include <flipper_format/flipper_format_i.h>
void subghz_dangerous_freq() {
bool is_extended_i = false;
Storage* storage = furi_record_open(RECORD_STORAGE);
FlipperFormat* fff_data_file = flipper_format_file_alloc(storage);
if(flipper_format_file_open_existing(fff_data_file, "/ext/subghz/assets/dangerous_settings")) {
flipper_format_read_bool(
fff_data_file, "yes_i_want_to_destroy_my_flipper", &is_extended_i, 1);
}
furi_hal_subghz_set_dangerous_frequency(is_extended_i);
flipper_format_free(fff_data_file);
furi_record_close(RECORD_STORAGE);
}

View File

@@ -0,0 +1,19 @@
#include <furi.h>
#include <furi_hal.h>
#include <furi_hal_subghz_i.h>
#include <flipper_format/flipper_format_i.h>
void subghz_extended_freq() {
bool is_extended_i = false;
Storage* storage = furi_record_open(RECORD_STORAGE);
FlipperFormat* file = flipper_format_file_alloc(storage);
if(flipper_format_file_open_existing(file, "/ext/subghz/assets/extend_range.txt")) {
flipper_format_read_bool(file, "use_ext_range_at_own_risk", &is_extended_i, 1);
}
furi_hal_subghz_set_extended_frequency(is_extended_i);
flipper_format_free(file);
furi_record_close(RECORD_STORAGE);
}