mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-21 10:13:10 +00:00
98bc190ac4
* ReadMe: update flashing scripts section * Furi: add record exists method to record store. * FuriHal: early OS init and i2c timeouts based on os ticks. * Storage: replace malloc with furi_alloc, fix errors found by pvs. * iButton: properly handle shutdown in cli search command * SubGhz: proper argument type in sscanf and incorrect position of logging in switch.
66 lines
1.4 KiB
C
66 lines
1.4 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 appear
|
|
*/
|
|
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
|