2021-05-24 16:44:14 +03:00
|
|
|
#include <furi.h>
|
2022-01-05 19:10:18 +03:00
|
|
|
#include <furi_hal.h>
|
2021-05-24 16:44:14 +03:00
|
|
|
#include "notification.h"
|
2022-01-05 19:10:18 +03:00
|
|
|
#include "notification_app.h"
|
2021-05-24 16:44:14 +03:00
|
|
|
|
|
|
|
void notification_message(NotificationApp* app, const NotificationSequence* sequence) {
|
2024-03-19 17:43:52 +03:00
|
|
|
furi_check(app);
|
|
|
|
furi_check(sequence);
|
|
|
|
|
2021-05-24 16:44:14 +03:00
|
|
|
NotificationAppMessage m = {
|
|
|
|
.type = NotificationLayerMessage, .sequence = sequence, .back_event = NULL};
|
2022-07-20 13:56:33 +03:00
|
|
|
furi_check(furi_message_queue_put(app->queue, &m, FuriWaitForever) == FuriStatusOk);
|
2024-07-15 20:02:45 +03:00
|
|
|
}
|
2021-05-24 16:44:14 +03:00
|
|
|
|
|
|
|
void notification_internal_message(NotificationApp* app, const NotificationSequence* sequence) {
|
2024-03-19 17:43:52 +03:00
|
|
|
furi_check(app);
|
|
|
|
furi_check(sequence);
|
|
|
|
|
2021-05-24 16:44:14 +03:00
|
|
|
NotificationAppMessage m = {
|
|
|
|
.type = InternalLayerMessage, .sequence = sequence, .back_event = NULL};
|
2022-07-20 13:56:33 +03:00
|
|
|
furi_check(furi_message_queue_put(app->queue, &m, FuriWaitForever) == FuriStatusOk);
|
2024-07-15 20:02:45 +03:00
|
|
|
}
|
2021-05-24 16:44:14 +03:00
|
|
|
|
|
|
|
void notification_message_block(NotificationApp* app, const NotificationSequence* sequence) {
|
2024-03-19 17:43:52 +03:00
|
|
|
furi_check(app);
|
|
|
|
furi_check(sequence);
|
|
|
|
|
2021-05-24 16:44:14 +03:00
|
|
|
NotificationAppMessage m = {
|
|
|
|
.type = NotificationLayerMessage,
|
|
|
|
.sequence = sequence,
|
2022-07-20 13:56:33 +03:00
|
|
|
.back_event = furi_event_flag_alloc()};
|
|
|
|
furi_check(furi_message_queue_put(app->queue, &m, FuriWaitForever) == FuriStatusOk);
|
|
|
|
furi_event_flag_wait(
|
|
|
|
m.back_event, NOTIFICATION_EVENT_COMPLETE, FuriFlagWaitAny, FuriWaitForever);
|
|
|
|
furi_event_flag_free(m.back_event);
|
2024-07-15 20:02:45 +03:00
|
|
|
}
|
2021-05-24 16:44:14 +03:00
|
|
|
|
|
|
|
void notification_internal_message_block(
|
|
|
|
NotificationApp* app,
|
|
|
|
const NotificationSequence* sequence) {
|
2024-03-19 17:43:52 +03:00
|
|
|
furi_check(app);
|
|
|
|
furi_check(sequence);
|
|
|
|
|
2021-05-24 16:44:14 +03:00
|
|
|
NotificationAppMessage m = {
|
2022-07-20 13:56:33 +03:00
|
|
|
.type = InternalLayerMessage, .sequence = sequence, .back_event = furi_event_flag_alloc()};
|
|
|
|
furi_check(furi_message_queue_put(app->queue, &m, FuriWaitForever) == FuriStatusOk);
|
|
|
|
furi_event_flag_wait(
|
|
|
|
m.back_event, NOTIFICATION_EVENT_COMPLETE, FuriFlagWaitAny, FuriWaitForever);
|
|
|
|
furi_event_flag_free(m.back_event);
|
2024-07-15 20:02:45 +03:00
|
|
|
}
|