mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-27 15:22:29 +03:00
9b9edf2fbf
* Rpc: debug request logging * Furi, Cli: replace global thread callback with local ring buffers, fix log command
37 lines
847 B
C
37 lines
847 B
C
/**
|
|
* @file stdglue.h
|
|
* Furi: stdlibc glue
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <stdbool.h>
|
|
#include <stdlib.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/** Write callback
|
|
* @param _cookie pointer to cookie (see stdio gnu extension)
|
|
* @param data pointer to data
|
|
* @param size data size @warnign your handler must consume everything
|
|
*/
|
|
typedef void (*FuriStdglueWriteCallback)(void* _cookie, const char* data, size_t size);
|
|
|
|
/** Initialized std library glue code */
|
|
void furi_stdglue_init();
|
|
|
|
/** Set STDOUT callback for your thread
|
|
*
|
|
* @param callback callback or NULL to clear
|
|
*
|
|
* @return true on success, otherwise fail
|
|
* @warning function is thread aware, use this API from the same thread
|
|
*/
|
|
bool furi_stdglue_set_thread_stdout_callback(FuriStdglueWriteCallback callback);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|