mirror of
https://github.com/flipperdevices/flipperzero-firmware.git
synced 2025-12-12 04:41:26 +04:00
[FL-3833] Furi: event loop (#3675)
* Furi: epoll prototype * Gui: simplify view_dispatcher custom event processing * Furi: add missing critical sections to epoll * Furi: add epoll unit tests, fully implement level processing for in and out events * Furi: properly trigger epoll item event on adding mq, update tests. * Unit tests: cleanup defines * Furi: protect epoll from modification in callback * Furi: rename epoll into event_loop, cleanup api naming * Sync API Symbols * Furi: add event loop contract and link api, port mq to new api, cleanup code * Format Sources * Furi: cleanup mq and event loop code * Furi: remove unused staff from message queue * ApiSymbols: remove event loop from public APIs. * Fix furi unit tests --------- Co-authored-by: Georgii Surkov <georgii.surkov@outlook.com> Co-authored-by: Georgii Surkov <37121527+gsurkov@users.noreply.github.com>
This commit is contained in:
33
furi/core/event_loop_i.h
Normal file
33
furi/core/event_loop_i.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#pragma once
|
||||
|
||||
#include "event_loop.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct FuriEventLoopItem FuriEventLoopItem;
|
||||
|
||||
/* Link between Event Loop */
|
||||
|
||||
typedef struct {
|
||||
FuriEventLoopItem* item_in;
|
||||
FuriEventLoopItem* item_out;
|
||||
} FuriEventLoopLink;
|
||||
|
||||
void furi_event_loop_link_notify(FuriEventLoopLink* instance, FuriEventLoopEvent event);
|
||||
|
||||
/* Contract between event loop and an object */
|
||||
|
||||
typedef FuriEventLoopLink* (*FuriEventLoopContractGetLink)(void* object);
|
||||
|
||||
typedef uint32_t (*FuriEventLoopContractGetLevel)(void* object, FuriEventLoopEvent event);
|
||||
|
||||
typedef struct {
|
||||
const FuriEventLoopContractGetLink get_link;
|
||||
const FuriEventLoopContractGetLevel get_level;
|
||||
} FuriEventLoopContract;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user