From 735fe31f3bc7e5f05dafb345250674f3c37fe48e Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Wed, 10 May 2023 22:56:56 +0300 Subject: [PATCH] Fmt and cleanup some "if"s in protocols --- applications/main/subghz/scenes/subghz_scene_decode_raw.c | 3 ++- lib/subghz/protocols/alutech_at_4n.c | 6 ++---- lib/subghz/protocols/kinggates_stylo_4k.c | 4 +--- lib/subghz/protocols/somfy_keytis.c | 6 ++---- lib/subghz/protocols/somfy_telis.c | 6 ++---- lib/subghz/protocols/star_line.c | 6 ++---- 6 files changed, 11 insertions(+), 20 deletions(-) diff --git a/applications/main/subghz/scenes/subghz_scene_decode_raw.c b/applications/main/subghz/scenes/subghz_scene_decode_raw.c index 5ad12b509..7dead8d4e 100644 --- a/applications/main/subghz/scenes/subghz_scene_decode_raw.c +++ b/applications/main/subghz/scenes/subghz_scene_decode_raw.c @@ -29,7 +29,8 @@ static void subghz_scene_receiver_update_statusbar(void* context) { FuriString* frequency_str = furi_string_alloc(); FuriString* modulation_str = furi_string_alloc(); - subghz_txrx_get_frequency_and_modulation(subghz->txrx, frequency_str, modulation_str, false); + subghz_txrx_get_frequency_and_modulation( + subghz->txrx, frequency_str, modulation_str, false); subghz_view_receiver_add_data_statusbar( subghz->subghz_receiver, diff --git a/lib/subghz/protocols/alutech_at_4n.c b/lib/subghz/protocols/alutech_at_4n.c index 20dae49c1..47cf37d6b 100644 --- a/lib/subghz/protocols/alutech_at_4n.c +++ b/lib/subghz/protocols/alutech_at_4n.c @@ -429,10 +429,8 @@ static bool subghz_protocol_encoder_alutech_at_4n_get_upload( if((custom_btn_id == 0) && (original_btn_num != 0)) { btn = original_btn_num; } - //gen new key - if(subghz_protocol_alutech_at_4n_gen_data(instance, btn)) { - //ToDo if you need to add a callback to automatically update the data on the display - } else { + // Gen new key + if(!subghz_protocol_alutech_at_4n_gen_data(instance, btn)) { return false; } diff --git a/lib/subghz/protocols/kinggates_stylo_4k.c b/lib/subghz/protocols/kinggates_stylo_4k.c index a9127d2b1..c5d21bcb0 100644 --- a/lib/subghz/protocols/kinggates_stylo_4k.c +++ b/lib/subghz/protocols/kinggates_stylo_4k.c @@ -197,9 +197,7 @@ static bool subghz_protocol_encoder_kinggates_stylo_4k_get_upload( furi_assert(instance); // Gen new key - if(subghz_protocol_kinggates_stylo_4k_gen_data(instance, btn)) { - //ToDo if you need to add a callback to automatically update the data on the display - } else { + if(!subghz_protocol_kinggates_stylo_4k_gen_data(instance, btn)) { return false; } diff --git a/lib/subghz/protocols/somfy_keytis.c b/lib/subghz/protocols/somfy_keytis.c index dd860a61d..4074d757b 100644 --- a/lib/subghz/protocols/somfy_keytis.c +++ b/lib/subghz/protocols/somfy_keytis.c @@ -208,10 +208,8 @@ static bool subghz_protocol_encoder_somfy_keytis_get_upload( uint8_t btn) { furi_assert(instance); - //gen new key - if(subghz_protocol_somfy_keytis_gen_data(instance, btn)) { - //ToDo if you need to add a callback to automatically update the data on the display - } else { + // Gen new key + if(!subghz_protocol_somfy_keytis_gen_data(instance, btn)) { return false; } diff --git a/lib/subghz/protocols/somfy_telis.c b/lib/subghz/protocols/somfy_telis.c index 047efb688..57c6c510b 100644 --- a/lib/subghz/protocols/somfy_telis.c +++ b/lib/subghz/protocols/somfy_telis.c @@ -254,10 +254,8 @@ static bool subghz_protocol_encoder_somfy_telis_get_upload( uint8_t btn) { furi_assert(instance); - //gen new key - if(subghz_protocol_somfy_telis_gen_data(instance, btn, false)) { - //ToDo if you need to add a callback to automatically update the data on the display - } else { + // Gen new key + if(!subghz_protocol_somfy_telis_gen_data(instance, btn, false)) { return false; } diff --git a/lib/subghz/protocols/star_line.c b/lib/subghz/protocols/star_line.c index 181dee643..cb9b26760 100644 --- a/lib/subghz/protocols/star_line.c +++ b/lib/subghz/protocols/star_line.c @@ -237,10 +237,8 @@ static bool subghz_protocol_encoder_star_line_get_upload( uint8_t btn) { furi_assert(instance); - //gen new key - if(subghz_protocol_star_line_gen_data(instance, btn)) { - //ToDo if you need to add a callback to automatically update the data on the display - } else { + // Gen new key + if(!subghz_protocol_star_line_gen_data(instance, btn)) { return false; }