mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-23 05:14:16 +03:00
6d823835df
* Core: event_flag, removing duplicate code * event_loop: add support furi_event_flags * Examples: add missing free in event loop examples * Furi: fix event flag * Sync api symbols * Unit_test: evet_loop_event_flags * Fix multiple waiting list elements handling * Unit_test: add event_loop_event_flag test * FURI: event_loop add restrictions * Fix multiple waiting lists items for good * Improve FuriEventLoop unit tests * Abolish callback return value * Remove return value from callback signature * Use bool level value instead of int32_t * Add unit tests for FuriStreamBuffer * Add unit tests for FuriSemaphore * Speed up test execution * Improve docs * Add a stub for furi os-level primitives * Add more checks for edge cases * Allow event loop notification from ISR * Bump api version Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com> Co-authored-by: Georgii Surkov <georgii.surkov@outlook.com> Co-authored-by: Georgii Surkov <37121527+gsurkov@users.noreply.github.com>
35 lines
776 B
C
35 lines
776 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)(FuriEventLoopObject* object);
|
|
|
|
typedef bool (
|
|
*FuriEventLoopContractGetLevel)(FuriEventLoopObject* object, FuriEventLoopEvent event);
|
|
|
|
typedef struct {
|
|
const FuriEventLoopContractGetLink get_link;
|
|
const FuriEventLoopContractGetLevel get_level;
|
|
} FuriEventLoopContract;
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|