mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-07 22:58:10 -07:00
Merge branch 'dev' into subrem_new_app
This commit is contained in:
@@ -10,7 +10,10 @@ App(
|
||||
"cli",
|
||||
"dialogs",
|
||||
],
|
||||
provides=["subghz_start"],
|
||||
provides=[
|
||||
"subghz_start",
|
||||
"subghz_load_dangerous_settings",
|
||||
],
|
||||
icon="A_Sub1ghz_14",
|
||||
stack_size=3 * 1024,
|
||||
order=10,
|
||||
@@ -23,3 +26,11 @@ App(
|
||||
requires=["subghz"],
|
||||
order=40,
|
||||
)
|
||||
|
||||
App(
|
||||
appid="subghz_load_dangerous_settings",
|
||||
apptype=FlipperAppType.STARTUP,
|
||||
entry_point="subghz_dangerous_freq",
|
||||
requires=["storage", "subghz"],
|
||||
order=650,
|
||||
)
|
||||
|
||||
@@ -25,11 +25,14 @@ const char* const debug_pin_text[DEBUG_P_COUNT] = {
|
||||
"17(1W)",
|
||||
};
|
||||
|
||||
#define DEBUG_COUNTER_COUNT 3
|
||||
#define DEBUG_COUNTER_COUNT 6
|
||||
const char* const debug_counter_text[DEBUG_COUNTER_COUNT] = {
|
||||
"+1",
|
||||
"+2",
|
||||
"+3",
|
||||
"+4",
|
||||
"+5",
|
||||
"+10",
|
||||
};
|
||||
|
||||
static void subghz_scene_ext_module_changed(VariableItem* item) {
|
||||
@@ -71,6 +74,15 @@ static void subghz_scene_receiver_config_set_debug_counter(VariableItem* item) {
|
||||
case 2:
|
||||
furi_hal_subghz_set_rolling_counter_mult(3);
|
||||
break;
|
||||
case 3:
|
||||
furi_hal_subghz_set_rolling_counter_mult(4);
|
||||
break;
|
||||
case 4:
|
||||
furi_hal_subghz_set_rolling_counter_mult(5);
|
||||
break;
|
||||
case 5:
|
||||
furi_hal_subghz_set_rolling_counter_mult(10);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -140,24 +152,58 @@ void subghz_scene_radio_settings_on_enter(void* context) {
|
||||
variable_item_set_current_value_index(item, value_index);
|
||||
variable_item_set_current_value_text(item, timestamp_names_text[value_index]);
|
||||
|
||||
item = variable_item_list_add(
|
||||
subghz->variable_item_list,
|
||||
"Counter incr.",
|
||||
DEBUG_COUNTER_COUNT,
|
||||
subghz_scene_receiver_config_set_debug_counter,
|
||||
subghz);
|
||||
switch(furi_hal_subghz_get_rolling_counter_mult()) {
|
||||
case 1:
|
||||
value_index = 0;
|
||||
break;
|
||||
case 2:
|
||||
value_index = 1;
|
||||
break;
|
||||
case 3:
|
||||
value_index = 2;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) {
|
||||
item = variable_item_list_add(
|
||||
subghz->variable_item_list,
|
||||
"Counter incr.",
|
||||
DEBUG_COUNTER_COUNT,
|
||||
subghz_scene_receiver_config_set_debug_counter,
|
||||
subghz);
|
||||
switch(furi_hal_subghz_get_rolling_counter_mult()) {
|
||||
case 1:
|
||||
value_index = 0;
|
||||
break;
|
||||
case 2:
|
||||
value_index = 1;
|
||||
break;
|
||||
case 3:
|
||||
value_index = 2;
|
||||
break;
|
||||
case 4:
|
||||
value_index = 3;
|
||||
break;
|
||||
case 5:
|
||||
value_index = 4;
|
||||
break;
|
||||
case 10:
|
||||
value_index = 5;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
item = variable_item_list_add(
|
||||
subghz->variable_item_list,
|
||||
"Counter incr.",
|
||||
3,
|
||||
subghz_scene_receiver_config_set_debug_counter,
|
||||
subghz);
|
||||
switch(furi_hal_subghz_get_rolling_counter_mult()) {
|
||||
case 1:
|
||||
value_index = 0;
|
||||
break;
|
||||
case 2:
|
||||
value_index = 1;
|
||||
break;
|
||||
case 3:
|
||||
value_index = 2;
|
||||
break;
|
||||
default:
|
||||
// Reset to default value
|
||||
value_index = 0;
|
||||
furi_hal_subghz_set_rolling_counter_mult(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
variable_item_set_current_value_index(item, value_index);
|
||||
variable_item_set_current_value_text(item, debug_counter_text[value_index]);
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
#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);
|
||||
}
|
||||
Reference in New Issue
Block a user