unleashed-firmware/applications/services/notification/notification_app_api.c
hedger 03196fa110
cleanup of various warnings from clangd (#3682)
* cleanup of various warnings from clangs
* lfrfid_debug: cast fixes
* subghz: binraw: round->roundf
* furi: thread: updated internal stack size variable to size_t
* github: fail faster on unsuccessful build
* unit_tests: double trouble
2024-06-03 14:43:23 +01:00

51 lines
1.8 KiB
C

#include <furi.h>
#include <furi_hal.h>
#include "notification.h"
#include "notification_app.h"
void notification_message(NotificationApp* app, const NotificationSequence* sequence) {
furi_check(app);
furi_check(sequence);
NotificationAppMessage m = {
.type = NotificationLayerMessage, .sequence = sequence, .back_event = NULL};
furi_check(furi_message_queue_put(app->queue, &m, FuriWaitForever) == FuriStatusOk);
};
void notification_internal_message(NotificationApp* app, const NotificationSequence* sequence) {
furi_check(app);
furi_check(sequence);
NotificationAppMessage m = {
.type = InternalLayerMessage, .sequence = sequence, .back_event = NULL};
furi_check(furi_message_queue_put(app->queue, &m, FuriWaitForever) == FuriStatusOk);
};
void notification_message_block(NotificationApp* app, const NotificationSequence* sequence) {
furi_check(app);
furi_check(sequence);
NotificationAppMessage m = {
.type = NotificationLayerMessage,
.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);
};
void notification_internal_message_block(
NotificationApp* app,
const NotificationSequence* sequence) {
furi_check(app);
furi_check(sequence);
NotificationAppMessage m = {
.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);
};