flipperzero-firmware/furi/core/record.h
あく e3c7201a20
Furi: core refactoring and CMSIS removal part 2 (#1410)
* Furi: rename and move core
* Furi: drop CMSIS_OS header and unused api, partially refactor and cleanup the rest
* Furi: CMSIS_OS drop and refactoring.
* Furi: refactoring, remove cmsis legacy
* Furi: fix incorrect assert on queue deallocation, cleanup timer
* Furi: improve delay api, get rid of floats
* hal: dropped furi_hal_crc
* Furi: move DWT based delay to cortex HAL
* Furi: update core documentation

Co-authored-by: hedger <hedger@nanode.su>
2022-07-20 13:56:33 +03:00

67 lines
1.5 KiB
C

/**
* @file record.h
* Furi: record API
*/
#pragma once
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
/** Initialize record storage For internal use only.
*/
void furi_record_init();
/** Check if record exists
*
* @param name record name
* @note Thread safe. Create and destroy must be executed from the same
* thread.
*/
bool furi_record_exists(const char* name);
/** Create record
*
* @param name record name
* @param data data pointer
* @note Thread safe. Create and destroy must be executed from the same
* thread.
*/
void furi_record_create(const char* name, void* data);
/** Destroy record
*
* @param name record name
*
* @return true if successful, false if still have holders or thread is not
* owner.
* @note Thread safe. Create and destroy must be executed from the same
* thread.
*/
bool furi_record_destroy(const char* name);
/** Open record
*
* @param name record name
*
* @return pointer to the record
* @note Thread safe. Open and close must be executed from the same
* thread. Suspends caller thread till record is available
*/
void* furi_record_open(const char* name);
/** Close record
*
* @param name record name
* @note Thread safe. Open and close must be executed from the same
* thread.
*/
void furi_record_close(const char* name);
#ifdef __cplusplus
}
#endif