Rename some vars

This commit is contained in:
MX 2023-02-26 05:25:22 +03:00
parent b53924c27a
commit a71abedd25
No known key found for this signature in database
GPG Key ID: 7CCC66B7DBDD1C83

View File

@ -1,9 +1,9 @@
#include "../subghz_i.h" #include "../subghz_i.h"
#include "../helpers/subghz_custom_event.h" #include "../helpers/subghz_custom_event.h"
uint8_t value_index; uint8_t value_index_exm;
uint8_t value_index2; uint8_t value_index_dpin;
uint8_t value_index3; uint8_t value_index_cnt;
#define EXT_MODULES_COUNT (sizeof(radio_modules_variables_text) / sizeof(char* const)) #define EXT_MODULES_COUNT (sizeof(radio_modules_variables_text) / sizeof(char* const))
const char* const radio_modules_variables_text[] = { const char* const radio_modules_variables_text[] = {
@ -26,10 +26,10 @@ const char* const debug_counter_text[DEBUG_COUNTER_COUNT] = {
static void subghz_scene_ext_module_changed(VariableItem* item) { static void subghz_scene_ext_module_changed(VariableItem* item) {
SubGhz* subghz = variable_item_get_context(item); SubGhz* subghz = variable_item_get_context(item);
value_index = variable_item_get_current_value_index(item); value_index_exm = variable_item_get_current_value_index(item);
UNUSED(subghz); UNUSED(subghz);
variable_item_set_current_value_text(item, radio_modules_variables_text[value_index]); variable_item_set_current_value_text(item, radio_modules_variables_text[value_index_exm]);
} }
static void subghz_ext_module_start_var_list_enter_callback(void* context, uint32_t index) { static void subghz_ext_module_start_var_list_enter_callback(void* context, uint32_t index) {
SubGhz* subghz = context; SubGhz* subghz = context;
@ -70,15 +70,15 @@ void subghz_scene_ext_module_settings_on_enter(void* context) {
VariableItemList* variable_item_list = subghz->variable_item_list; VariableItemList* variable_item_list = subghz->variable_item_list;
value_index = furi_hal_subghz.radio_type; value_index_exm = furi_hal_subghz.radio_type;
VariableItem* item = variable_item_list_add( VariableItem* item = variable_item_list_add(
variable_item_list, "Module", EXT_MODULES_COUNT, subghz_scene_ext_module_changed, subghz); variable_item_list, "Module", EXT_MODULES_COUNT, subghz_scene_ext_module_changed, subghz);
variable_item_list_set_enter_callback( variable_item_list_set_enter_callback(
variable_item_list, subghz_ext_module_start_var_list_enter_callback, subghz); variable_item_list, subghz_ext_module_start_var_list_enter_callback, subghz);
variable_item_set_current_value_index(item, value_index); variable_item_set_current_value_index(item, value_index_exm);
variable_item_set_current_value_text(item, radio_modules_variables_text[value_index]); variable_item_set_current_value_text(item, radio_modules_variables_text[value_index_exm]);
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) { if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) {
item = variable_item_list_add( item = variable_item_list_add(
@ -87,9 +87,9 @@ void subghz_scene_ext_module_settings_on_enter(void* context) {
DEBUG_P_COUNT, DEBUG_P_COUNT,
subghz_scene_receiver_config_set_debug_pin, subghz_scene_receiver_config_set_debug_pin,
subghz); subghz);
value_index2 = subghz->txrx->debug_pin_state; value_index_dpin = subghz->txrx->debug_pin_state;
variable_item_set_current_value_index(item, value_index2); variable_item_set_current_value_index(item, value_index_dpin);
variable_item_set_current_value_text(item, debug_pin_text[value_index2]); variable_item_set_current_value_text(item, debug_pin_text[value_index_dpin]);
item = variable_item_list_add( item = variable_item_list_add(
subghz->variable_item_list, subghz->variable_item_list,
@ -99,19 +99,19 @@ void subghz_scene_ext_module_settings_on_enter(void* context) {
subghz); subghz);
switch(furi_hal_subghz_get_rolling_counter_mult()) { switch(furi_hal_subghz_get_rolling_counter_mult()) {
case 1: case 1:
value_index3 = 0; value_index_cnt = 0;
break; break;
case 5: case 5:
value_index3 = 1; value_index_cnt = 1;
break; break;
case 10: case 10:
value_index3 = 2; value_index_cnt = 2;
break; break;
default: default:
break; break;
} }
variable_item_set_current_value_index(item, value_index3); variable_item_set_current_value_index(item, value_index_cnt);
variable_item_set_current_value_text(item, debug_counter_text[value_index3]); variable_item_set_current_value_text(item, debug_counter_text[value_index_cnt]);
} }
view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewIdVariableItemList); view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewIdVariableItemList);
@ -123,12 +123,12 @@ bool subghz_scene_ext_module_settings_on_event(void* context, SceneManagerEvent
UNUSED(event); UNUSED(event);
// Set selected radio module // Set selected radio module
furi_hal_subghz_set_radio_type(value_index); furi_hal_subghz_set_radio_type(value_index_exm);
// Check if module is present, if no -> show error // Check if module is present, if no -> show error
if(!furi_hal_subghz_check_radio()) { if(!furi_hal_subghz_check_radio()) {
value_index = 0; value_index_exm = 0;
furi_hal_subghz_set_radio_type(value_index); furi_hal_subghz_set_radio_type(value_index_exm);
furi_string_set(subghz->error_str, "Please connect\nexternal radio"); furi_string_set(subghz->error_str, "Please connect\nexternal radio");
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneShowErrorSub); scene_manager_next_scene(subghz->scene_manager, SubGhzSceneShowErrorSub);
} }