unleashed-firmware/applications/services/notification/notification_app_api.c
あく acc39a4bc0
Api Symbols: replace asserts with checks (#3507)
* Api Symbols: replace asserts with checks
* Api Symbols: replace asserts with checks part 2
* Update no args function signatures with void, to help compiler to track incorrect usage
* More unavoidable void
* Update PVS config and code to make it happy
* Format sources
* nfc: fix checks
* dead code cleanup & include fixes

Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: hedger <hedger@nanode.su>
2024-03-19 23:43:52 +09:00

52 lines
1.9 KiB
C

#include <furi.h>
#include <furi_hal.h>
#include "notification.h"
#include "notification_messages.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);
};