flipperzero-firmware/applications/notification/notification-app-api.c
SG dce3665f63
File worker helper. Slightly optimized iButton app code size. (#545)
* File worker: file operations helper
* Notification app: removed yield
* File worker: write operations, calls to system file widgets
* App ibutton: use file worker
* App ibutton: small save fix, forgotten byte
2021-06-29 16:08:45 +03:00

37 lines
1.6 KiB
C

#include <furi.h>
#include <api-hal.h>
#include "notification.h"
#include "notification-messages.h"
#include "notification-app.h"
void notification_message(NotificationApp* app, const NotificationSequence* sequence) {
NotificationAppMessage m = {
.type = NotificationLayerMessage, .sequence = sequence, .back_event = NULL};
furi_check(osMessageQueuePut(app->queue, &m, 0, osWaitForever) == osOK);
};
void notification_internal_message(NotificationApp* app, const NotificationSequence* sequence) {
NotificationAppMessage m = {
.type = InternalLayerMessage, .sequence = sequence, .back_event = NULL};
furi_check(osMessageQueuePut(app->queue, &m, 0, osWaitForever) == osOK);
};
void notification_message_block(NotificationApp* app, const NotificationSequence* sequence) {
NotificationAppMessage m = {
.type = NotificationLayerMessage,
.sequence = sequence,
.back_event = osEventFlagsNew(NULL)};
furi_check(osMessageQueuePut(app->queue, &m, 0, osWaitForever) == osOK);
osEventFlagsWait(m.back_event, NOTIFICATION_EVENT_COMPLETE, osFlagsWaitAny, osWaitForever);
osEventFlagsDelete(m.back_event);
};
void notification_internal_message_block(
NotificationApp* app,
const NotificationSequence* sequence) {
NotificationAppMessage m = {
.type = InternalLayerMessage, .sequence = sequence, .back_event = osEventFlagsNew(NULL)};
furi_check(osMessageQueuePut(app->queue, &m, 0, osWaitForever) == osOK);
osEventFlagsWait(m.back_event, NOTIFICATION_EVENT_COMPLETE, osFlagsWaitAny, osWaitForever);
osEventFlagsDelete(m.back_event);
};