unleashed-firmware/furi/core/event_loop_i.h
あく 6d8b050eda
[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>
2024-06-10 20:53:08 +03:00

33 lines
745 B
C

#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