mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 15:18:35 -07:00
commit 0b11b76df22abd1bbc18595e6472fe83acc65697 Author: Himura Kazuto <glagol15@gmail.com> Date: Sun Sep 18 17:25:38 2022 +0400 disable fran blink commit e9055f62b8131eca25c03dec9aab9e6a36548cb0 Author: Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> Date: Wed Aug 10 23:31:45 2022 +0400 frequency analyzer - better RSSI level trigger commit 95a3bc1371addb4903fc17f5fa4dda2966cab96a Author: Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> Date: Mon Aug 8 16:45:11 2022 +0400 Formatting commit 6062133170aac559fff037c8ff45d9e618030f12 Author: Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> Date: Mon Aug 8 16:36:40 2022 +0400 New frequency analyzer
39 lines
1.5 KiB
C
39 lines
1.5 KiB
C
#include "../subghz_i.h"
|
|
#include "../views/subghz_frequency_analyzer.h"
|
|
#include <dolphin/dolphin.h>
|
|
|
|
void subghz_scene_frequency_analyzer_callback(SubGhzCustomEvent event, void* context) {
|
|
furi_assert(context);
|
|
SubGhz* subghz = context;
|
|
view_dispatcher_send_custom_event(subghz->view_dispatcher, event);
|
|
}
|
|
|
|
void subghz_scene_frequency_analyzer_on_enter(void* context) {
|
|
SubGhz* subghz = context;
|
|
DOLPHIN_DEED(DolphinDeedSubGhzFrequencyAnalyzer);
|
|
subghz_frequency_analyzer_set_callback(
|
|
subghz->subghz_frequency_analyzer, subghz_scene_frequency_analyzer_callback, subghz);
|
|
view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewIdFrequencyAnalyzer);
|
|
}
|
|
|
|
bool subghz_scene_frequency_analyzer_on_event(void* context, SceneManagerEvent event) {
|
|
SubGhz* subghz = context;
|
|
if(event.type == SceneManagerEventTypeCustom) {
|
|
if(event.event == SubGhzCustomEventSceneAnalyzerLock) {
|
|
notification_message(subghz->notifications, &sequence_set_green_255);
|
|
notification_message(subghz->notifications, &sequence_set_vibro_on);
|
|
return true;
|
|
} else if(event.event == SubGhzCustomEventSceneAnalyzerUnlock) {
|
|
notification_message(subghz->notifications, &sequence_reset_rgb);
|
|
notification_message(subghz->notifications, &sequence_reset_vibro);
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
void subghz_scene_frequency_analyzer_on_exit(void* context) {
|
|
SubGhz* subghz = context;
|
|
notification_message(subghz->notifications, &sequence_reset_rgb);
|
|
}
|