mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-24 21:43:06 +00:00
e3c7201a20
* Furi: rename and move core * Furi: drop CMSIS_OS header and unused api, partially refactor and cleanup the rest * Furi: CMSIS_OS drop and refactoring. * Furi: refactoring, remove cmsis legacy * Furi: fix incorrect assert on queue deallocation, cleanup timer * Furi: improve delay api, get rid of floats * hal: dropped furi_hal_crc * Furi: move DWT based delay to cortex HAL * Furi: update core documentation Co-authored-by: hedger <hedger@nanode.su>
39 lines
1.7 KiB
C
39 lines
1.7 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) {
|
|
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) {
|
|
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) {
|
|
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) {
|
|
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);
|
|
};
|