Flipper Zero Firmware
|
Example application that demonstrates the FuriEventLoop and FuriStreamBuffer integration. More...
#include <furi.h>
#include <furi_hal_random.h>
Data Structures | |
struct | EventLoopStreamBufferApp |
Macros | |
#define | TAG "ExampleEventLoopStreamBuffer" |
#define | WORKER_ITERATION_COUNT (10) |
#define | STREAM_BUFFER_SIZE (32) |
#define | STREAM_BUFFER_TRIG_LEVEL (STREAM_BUFFER_SIZE / 2) |
#define | STREAM_BUFFER_EVENT_AND_FLAGS (FuriEventLoopEventIn | FuriEventLoopEventFlagEdge) |
Functions | |
int32_t | example_event_loop_stream_buffer_app (void *arg) |
Example application that demonstrates the FuriEventLoop and FuriStreamBuffer integration.
This application simulates a use case where some data data stream comes from a separate thread (or hardware) and a stream buffer is used to act as an intermediate buffer. The worker thread produces 10 iterations of 32 bytes of simulated data, and each time when the buffer is half-filled, the data is taken out of it and printed to the debug output. After completing all iterations, the application exits.