[FL-2700] Fix IR hangup with short signals (#1535)

* Do not use infrared worker callback for notifications
* Remove tx callback
* Port Infrared notifications to hardware blinker
* Move all blink message definitions to notification_messages.h
* Fix potential hangup after leaving debug scene
This commit is contained in:
Georgii Surkov
2022-08-04 15:11:01 +03:00
committed by GitHub
parent 4460010e76
commit 8a370d70dc
15 changed files with 81 additions and 94 deletions

View File

@@ -21,12 +21,14 @@ static void infrared_scene_universal_common_show_popup(Infrared* infrared, uint3
infrared_progress_view_set_back_callback(
progress, infrared_scene_universal_common_progress_back_callback, infrared);
view_stack_add_view(view_stack, infrared_progress_view_get_view(progress));
infrared_play_notification_message(infrared, InfraredNotificationMessageBlinkStartSend);
}
static void infrared_scene_universal_common_hide_popup(Infrared* infrared) {
ViewStack* view_stack = infrared->view_stack;
InfraredProgressView* progress = infrared->progress;
view_stack_remove_view(view_stack, infrared_progress_view_get_view(progress));
infrared_play_notification_message(infrared, InfraredNotificationMessageBlinkStop);
}
void infrared_scene_universal_common_on_enter(void* context) {
@@ -42,7 +44,6 @@ bool infrared_scene_universal_common_on_event(void* context, SceneManagerEvent e
if(infrared_brute_force_is_started(brute_force)) {
if(event.type == SceneManagerEventTypeTick) {
infrared_play_notification_message(infrared, InfraredNotificationMessageBlinkSend);
bool success = infrared_brute_force_send_next(brute_force);
if(success) {
success = infrared_progress_view_increase_progress(infrared->progress);
@@ -71,8 +72,6 @@ bool infrared_scene_universal_common_on_event(void* context, SceneManagerEvent e
brute_force, infrared_custom_event_get_value(event.event), &record_count)) {
DOLPHIN_DEED(DolphinDeedIrBruteForce);
infrared_scene_universal_common_show_popup(infrared, record_count);
infrared_play_notification_message(
infrared, InfraredNotificationMessageBlinkSend);
} else {
scene_manager_next_scene(scene_manager, InfraredSceneErrorDatabases);
}