Flipper Zero Firmware
Loading...
Searching...
No Matches
event_loop.h
Go to the documentation of this file.
1
15#pragma once
16
17#include "base.h"
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
28
31
42
48
56
62
63/*
64 * Tick related API
65 */
66
71typedef void (*FuriEventLoopTickCallback)(void* context);
72
86 FuriEventLoop* instance,
87 uint32_t interval,
89 void* context);
90
91/*
92 * Deferred function call API
93 */
94
101typedef void (*FuriEventLoopPendingCallback)(void* context);
102
113 FuriEventLoop* instance,
115 void* context);
116
117/*
118 * Message queue related APIs
119 */
120
123
132typedef bool (*FuriEventLoopMessageQueueCallback)(FuriMessageQueue* queue, void* context);
133
145 FuriEventLoop* instance,
146 FuriMessageQueue* message_queue,
147 FuriEventLoopEvent event,
149 void* context);
150
157 FuriEventLoop* instance,
158 FuriMessageQueue* message_queue);
159
160#ifdef __cplusplus
161}
162#endif
void furi_event_loop_run(FuriEventLoop *instance)
Continuously poll for events.
Definition event_loop.c:106
void furi_event_loop_pend_callback(FuriEventLoop *instance, FuriEventLoopPendingCallback callback, void *context)
Call a function when all preceding timer commands are processed.
Definition event_loop.c:194
void furi_event_loop_free(FuriEventLoop *instance)
Free Event Loop instance.
Definition event_loop.c:63
void furi_event_loop_stop(FuriEventLoop *instance)
Stop Event Loop instance.
Definition event_loop.c:183
FuriEventLoop * furi_event_loop_alloc(void)
Allocate Event Loop instance.
Definition event_loop.c:44
void(* FuriEventLoopPendingCallback)(void *context)
Timer callback type for functions to be called in a deferred manner.
Definition event_loop.h:101
FuriEventLoopEvent
Event Loop events.
Definition event_loop.h:24
@ FuriEventLoopEventIn
On arrival: item was inserted into container, flag set, etc...
Definition event_loop.h:26
@ FuriEventLoopEventOut
On departure: item was retrieved from container, flag reset, etc...
Definition event_loop.h:25
bool(* FuriEventLoopMessageQueueCallback)(FuriMessageQueue *queue, void *context)
Callback type for message queue.
Definition event_loop.h:132
void(* FuriEventLoopTickCallback)(void *context)
Tick callback type.
Definition event_loop.h:71
void furi_event_loop_message_queue_unsubscribe(FuriEventLoop *instance, FuriMessageQueue *message_queue)
Unsubscribe from message queue.
Definition event_loop.c:258
void furi_event_loop_tick_set(FuriEventLoop *instance, uint32_t interval, FuriEventLoopTickCallback callback, void *context)
Set Event Loop tick callback.
Definition event_loop_tick.c:56
void furi_event_loop_message_queue_subscribe(FuriEventLoop *instance, FuriMessageQueue *message_queue, FuriEventLoopEvent event, FuriEventLoopMessageQueueCallback callback, void *context)
Subscribe to message queue events.
Definition event_loop.c:217
Definition event_loop_i.h:78
Definition message_queue.c:14