simplified open/close record with transaction
This commit is contained in:
@@ -12,6 +12,19 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Opens a record, calls the code and then closes the record.
|
||||
* @param record_name const char* that contains the name of the record
|
||||
* @param variable_name the name of the variable that is used in the `code`
|
||||
* @param code the code to execute: consider putting it between {}
|
||||
*/
|
||||
#define FURI_RECORD_TRANSACTION(record_name, variable_name, code) \
|
||||
{ \
|
||||
NbGui* (variable_name) = (NbGui*)furi_record_open(record_name); \
|
||||
code \
|
||||
furi_record_close(record_name); \
|
||||
}
|
||||
|
||||
/** Initialize record storage For internal use only.
|
||||
*/
|
||||
void furi_record_init();
|
||||
|
||||
Reference in New Issue
Block a user