Add back cnt in debug

This commit is contained in:
MX 2023-05-19 04:49:29 +03:00
parent a7ee5fea93
commit 324186dad2
No known key found for this signature in database
GPG Key ID: 7CCC66B7DBDD1C83

View File

@ -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,6 +152,7 @@ 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]);
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) {
item = variable_item_list_add(
subghz->variable_item_list,
"Counter incr.",
@ -156,9 +169,42 @@ void subghz_scene_radio_settings_on_enter(void* context) {
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]);