Transferring and combining the functionality of "custom buttons" into a separate file.

This commit is contained in:
gid9798
2023-04-01 21:37:04 +03:00
parent f0d94e2757
commit 5603ed7ebb
18 changed files with 199 additions and 320 deletions

View File

@@ -2,11 +2,9 @@
#include "../views/transmitter.h"
#include <dolphin/dolphin.h>
#include <lib/subghz/protocols/keeloq.h>
#include <lib/subghz/protocols/alutech_at_4n.h>
#include <lib/subghz/protocols/star_line.h>
#include <lib/subghz/protocols/nice_flor_s.h>
#include <lib/subghz/protocols/somfy_telis.h>
#include <lib/subghz/protocols/secplus_v2.h>
#include <lib/subghz/blocks/custom_btn.h>
void subghz_scene_transmitter_callback(SubGhzCustomEvent event, void* context) {
furi_assert(context);
@@ -91,12 +89,8 @@ bool subghz_scene_transmitter_on_event(void* context, SceneManagerEvent event) {
subghz_tx_stop(subghz);
subghz_sleep(subghz);
}
if(keeloq_get_custom_btn() != 0) {
keeloq_set_btn(0);
alutech_set_btn(0);
nice_flors_set_btn(0);
somfy_telis_set_btn(0);
secplus2_set_btn(0);
if(subghz_custom_btn_get() != 0) {
subghz_custom_btn_set(0);
uint8_t tmp_counter = furi_hal_subghz_get_rolling_counter_mult();
furi_hal_subghz_set_rolling_counter_mult(0);
// Calling restore!
@@ -138,10 +132,7 @@ void subghz_scene_transmitter_on_exit(void* context) {
keeloq_reset_mfname();
keeloq_reset_kl_type();
keeloq_reset_original_btn();
alutech_reset_original_btn();
nice_flors_reset_original_btn();
somfy_telis_reset_original_btn();
secplus2_reset_original_btn();
subghz_custom_btns_reset();
star_line_reset_mfname();
star_line_reset_kl_type();
}