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)", "17(1W)",
}; };
#define DEBUG_COUNTER_COUNT 3 #define DEBUG_COUNTER_COUNT 6
const char* const debug_counter_text[DEBUG_COUNTER_COUNT] = { const char* const debug_counter_text[DEBUG_COUNTER_COUNT] = {
"+1", "+1",
"+2", "+2",
"+3", "+3",
"+4",
"+5",
"+10",
}; };
static void subghz_scene_ext_module_changed(VariableItem* item) { 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: case 2:
furi_hal_subghz_set_rolling_counter_mult(3); furi_hal_subghz_set_rolling_counter_mult(3);
break; 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: default:
break; 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_index(item, value_index);
variable_item_set_current_value_text(item, timestamp_names_text[value_index]); variable_item_set_current_value_text(item, timestamp_names_text[value_index]);
item = variable_item_list_add( if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) {
subghz->variable_item_list, item = variable_item_list_add(
"Counter incr.", subghz->variable_item_list,
DEBUG_COUNTER_COUNT, "Counter incr.",
subghz_scene_receiver_config_set_debug_counter, DEBUG_COUNTER_COUNT,
subghz); subghz_scene_receiver_config_set_debug_counter,
switch(furi_hal_subghz_get_rolling_counter_mult()) { subghz);
case 1: switch(furi_hal_subghz_get_rolling_counter_mult()) {
value_index = 0; case 1:
break; value_index = 0;
case 2: break;
value_index = 1; case 2:
break; value_index = 1;
case 3: break;
value_index = 2; case 3:
break; value_index = 2;
default: break;
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_index(item, value_index);
variable_item_set_current_value_text(item, debug_counter_text[value_index]); variable_item_set_current_value_text(item, debug_counter_text[value_index]);