mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 16:28:36 -07:00
New improvements
1) SubGhz: consciousness and transmission support Security+ 1.0 SAVE AND SEND! ; 2) SubGhz: fix incorrect shutdown of CC1101 if it was not turned on; 3) SubGhz: fix frequency reset on incomplete exit from the transmission menu
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "../subghz_i.h"
|
||||
#include <lib/subghz/protocols/keeloq.h>
|
||||
#include <lib/subghz/protocols/faac_slh.h>
|
||||
#include <lib/subghz/protocols/secplus_v1.h>
|
||||
#include <lib/subghz/blocks/math.h>
|
||||
#include <dolphin/dolphin.h>
|
||||
#include <flipper_format/flipper_format_i.h>
|
||||
@@ -23,6 +24,8 @@ enum SubmenuIndex {
|
||||
SubmenuIndexDoorHan_315_00,
|
||||
SubmenuIndexDoorHan_433_92,
|
||||
SubmenuIndexFirefly_300_00,
|
||||
SubmenuIndexLiftMaster_315_00,
|
||||
SubmenuIndexLiftMaster_390_00,
|
||||
};
|
||||
|
||||
bool subghz_scene_set_type_submenu_gen_data_protocol(
|
||||
@@ -150,6 +153,18 @@ void subghz_scene_set_type_on_enter(void* context) {
|
||||
SubmenuIndexDoorHan_433_92,
|
||||
subghz_scene_set_type_submenu_callback,
|
||||
subghz);
|
||||
submenu_add_item(
|
||||
subghz->submenu,
|
||||
"LiftMaster_315",
|
||||
SubmenuIndexLiftMaster_315_00,
|
||||
subghz_scene_set_type_submenu_callback,
|
||||
subghz);
|
||||
submenu_add_item(
|
||||
subghz->submenu,
|
||||
"LiftMaster_390",
|
||||
SubmenuIndexLiftMaster_390_00,
|
||||
subghz_scene_set_type_submenu_callback,
|
||||
subghz);
|
||||
|
||||
submenu_set_selected_item(
|
||||
subghz->submenu, scene_manager_get_scene_state(subghz->scene_manager, SubGhzSceneSetType));
|
||||
@@ -322,6 +337,37 @@ bool subghz_scene_set_type_on_event(void* context, SceneManagerEvent event) {
|
||||
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneShowError);
|
||||
}
|
||||
break;
|
||||
case SubmenuIndexLiftMaster_315_00:
|
||||
while(!subghz_protocol_secplus_v1_check_fixed(key)) {
|
||||
key = subghz_random_serial();
|
||||
}
|
||||
|
||||
if(subghz_scene_set_type_submenu_gen_data_protocol(
|
||||
subghz,
|
||||
SUBGHZ_PROTOCOL_SECPLUS_V1_NAME,
|
||||
(uint64_t)key << 32 | 32,
|
||||
42,
|
||||
315000000,
|
||||
FuriHalSubGhzPresetOok650Async)) {
|
||||
generated_protocol = true;
|
||||
}
|
||||
break;
|
||||
case SubmenuIndexLiftMaster_390_00:
|
||||
while(!subghz_protocol_secplus_v1_check_fixed(key)) {
|
||||
key = subghz_random_serial();
|
||||
}
|
||||
|
||||
if(subghz_scene_set_type_submenu_gen_data_protocol(
|
||||
subghz,
|
||||
SUBGHZ_PROTOCOL_SECPLUS_V1_NAME,
|
||||
(uint64_t)key << 32 | 32,
|
||||
42,
|
||||
390000000,
|
||||
FuriHalSubGhzPresetOok650Async)) {
|
||||
generated_protocol = true;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
break;
|
||||
|
||||
@@ -108,8 +108,5 @@ bool subghz_scene_transmitter_on_event(void* context, SceneManagerEvent event) {
|
||||
|
||||
void subghz_scene_transmitter_on_exit(void* context) {
|
||||
SubGhz* subghz = context;
|
||||
//Restore default setting
|
||||
subghz->txrx->frequency = subghz_setting_get_default_frequency(subghz->setting);
|
||||
subghz->txrx->preset = FuriHalSubGhzPresetOok650Async;
|
||||
subghz->state_notifications = SubGhzNotificationStateIDLE;
|
||||
}
|
||||
|
||||
@@ -171,7 +171,9 @@ bool subghz_tx_start(SubGhz* subghz, FlipperFormat* flipper_format) {
|
||||
}
|
||||
if(!ret) {
|
||||
subghz_transmitter_free(subghz->txrx->transmitter);
|
||||
subghz_idle(subghz);
|
||||
if(subghz->txrx->txrx_state != SubGhzTxRxStateSleep) {
|
||||
subghz_idle(subghz);
|
||||
}
|
||||
}
|
||||
|
||||
} while(false);
|
||||
|
||||
Reference in New Issue
Block a user