mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-12 12:42:30 +04:00
Fmt and cleanup some "if"s in protocols
This commit is contained in:
@@ -29,7 +29,8 @@ static void subghz_scene_receiver_update_statusbar(void* context) {
|
|||||||
FuriString* frequency_str = furi_string_alloc();
|
FuriString* frequency_str = furi_string_alloc();
|
||||||
FuriString* modulation_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_view_receiver_add_data_statusbar(
|
||||||
subghz->subghz_receiver,
|
subghz->subghz_receiver,
|
||||||
|
|||||||
@@ -429,10 +429,8 @@ static bool subghz_protocol_encoder_alutech_at_4n_get_upload(
|
|||||||
if((custom_btn_id == 0) && (original_btn_num != 0)) {
|
if((custom_btn_id == 0) && (original_btn_num != 0)) {
|
||||||
btn = original_btn_num;
|
btn = original_btn_num;
|
||||||
}
|
}
|
||||||
//gen new key
|
// Gen new key
|
||||||
if(subghz_protocol_alutech_at_4n_gen_data(instance, btn)) {
|
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 {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -197,9 +197,7 @@ static bool subghz_protocol_encoder_kinggates_stylo_4k_get_upload(
|
|||||||
furi_assert(instance);
|
furi_assert(instance);
|
||||||
|
|
||||||
// Gen new key
|
// Gen new key
|
||||||
if(subghz_protocol_kinggates_stylo_4k_gen_data(instance, btn)) {
|
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 {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -208,10 +208,8 @@ static bool subghz_protocol_encoder_somfy_keytis_get_upload(
|
|||||||
uint8_t btn) {
|
uint8_t btn) {
|
||||||
furi_assert(instance);
|
furi_assert(instance);
|
||||||
|
|
||||||
//gen new key
|
// Gen new key
|
||||||
if(subghz_protocol_somfy_keytis_gen_data(instance, btn)) {
|
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 {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -254,10 +254,8 @@ static bool subghz_protocol_encoder_somfy_telis_get_upload(
|
|||||||
uint8_t btn) {
|
uint8_t btn) {
|
||||||
furi_assert(instance);
|
furi_assert(instance);
|
||||||
|
|
||||||
//gen new key
|
// Gen new key
|
||||||
if(subghz_protocol_somfy_telis_gen_data(instance, btn, false)) {
|
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 {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -237,10 +237,8 @@ static bool subghz_protocol_encoder_star_line_get_upload(
|
|||||||
uint8_t btn) {
|
uint8_t btn) {
|
||||||
furi_assert(instance);
|
furi_assert(instance);
|
||||||
|
|
||||||
//gen new key
|
// Gen new key
|
||||||
if(subghz_protocol_star_line_gen_data(instance, btn)) {
|
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 {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user