From 7fa5624c509789adb2ad83a608537710ee68837a Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Mon, 26 Jan 2026 12:45:57 +0300 Subject: [PATCH] Revert "start working with subghz button editor" This reverts commit 14abc959cf0fb86d9a2904a5028e3196ff80fe31. --- .../scenes/subghz_scene_signal_settings.c | 40 +------------------ lib/subghz/blocks/generic.h | 5 --- 2 files changed, 1 insertion(+), 44 deletions(-) diff --git a/applications/main/subghz/scenes/subghz_scene_signal_settings.c b/applications/main/subghz/scenes/subghz_scene_signal_settings.c index 548516683..e74219a28 100644 --- a/applications/main/subghz/scenes/subghz_scene_signal_settings.c +++ b/applications/main/subghz/scenes/subghz_scene_signal_settings.c @@ -14,7 +14,6 @@ static uint16_t counter16 = 0x0; static uint8_t byte_count = 0; static uint8_t* byte_ptr = NULL; static FuriString* byte_input_text; -static uint8_t button = 0x0; #define COUNTER_MODE_COUNT 7 static const char* const counter_mode_text[COUNTER_MODE_COUNT] = { @@ -75,23 +74,6 @@ void subghz_scene_signal_settings_variable_item_list_enter_callback(void* contex ByteInput* byte_input = subghz->byte_input; byte_input_set_header_text(byte_input, furi_string_get_cstr(byte_input_text)); - byte_input_set_result_callback( - byte_input, - subghz_scene_signal_settings_byte_input_callback, - NULL, - subghz, - byte_ptr, - byte_count); - view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewIdByteInput); - } - // when we click OK on "Edit button" item - if(index == 2) { - furi_string_cat_str(byte_input_text, " button number in HEX"); - - // Setup byte_input view - ByteInput* byte_input = subghz->byte_input; - byte_input_set_header_text(byte_input, furi_string_get_cstr(byte_input_text)); - byte_input_set_result_callback( byte_input, subghz_scene_signal_settings_byte_input_callback, @@ -148,10 +130,9 @@ void subghz_scene_signal_settings_on_enter(void* context) { flipper_format_free(fff_data_file); furi_record_close(RECORD_STORAGE); + // ### Counter edit section ### byte_input_text = furi_string_alloc_set_str("Enter "); bool counter_not_available = true; - bool button_not_available = true; - SubGhzProtocolDecoderBase* decoder = subghz_txrx_get_decoder(subghz->txrx); // deserialaze and decode loaded sugbhz file and push data to subghz_block_generic_global variable @@ -162,8 +143,6 @@ void subghz_scene_signal_settings_on_enter(void* context) { FURI_LOG_E(TAG, "Cant deserialize this subghz file"); } - // ### Counter edit section ### - if(!subghz_block_generic_global.cnt_is_available) { counter_mode = 0xff; FURI_LOG_D(TAG, "Counter mode and edit not available for this protocol"); @@ -187,18 +166,6 @@ void subghz_scene_signal_settings_on_enter(void* context) { } } - // ### Button edit section ### - - if(!subghz_block_generic_global.btn_is_available) { - FURI_LOG_D(TAG, "Button edit not available for this protocol"); - } else { - button_not_available = false; - button = subghz_block_generic_global.current_btn; - furi_string_printf(tmp_text, "%X", button); - byte_ptr = (uint8_t*)&button; - byte_count = 1; - } - furi_assert(byte_ptr); furi_assert(byte_count > 0); @@ -229,11 +196,6 @@ void subghz_scene_signal_settings_on_enter(void* context) { variable_item_set_current_value_text(item, furi_string_get_cstr(tmp_text)); variable_item_set_locked(item, (counter_not_available), "Not available\nfor this\nprotocol !"); - item = variable_item_list_add(variable_item_list, "Edit Button", 1, NULL, subghz); - variable_item_set_current_value_index(item, 0); - variable_item_set_current_value_text(item, furi_string_get_cstr(tmp_text)); - variable_item_set_locked(item, (button_not_available), "Not available\nfor this\nprotocol !"); - furi_string_free(tmp_text); view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewIdVariableItemList); diff --git a/lib/subghz/blocks/generic.h b/lib/subghz/blocks/generic.h index d3f7804dc..1e72c5a5e 100644 --- a/lib/subghz/blocks/generic.h +++ b/lib/subghz/blocks/generic.h @@ -35,11 +35,6 @@ struct SubGhzBlockGenericGlobal { bool cnt_need_override; // flag for protocols to override signals counter inside of protocols uint8_t cnt_length_bit; // counter length in bytes (used in counter editor giu) bool cnt_is_available; // is there counter available for protocol (used in counter editor giu) - - uint8_t current_btn; // global counter value; - uint8_t new_btn; // global counter value; - bool btn_need_override; // flag for protocols to override signals counter inside of protocols - bool btn_is_available; // is there counter available for protocol (used in counter editor giu) }; extern SubGhzBlockGenericGlobal subghz_block_generic_global; //global structure for subghz