mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-24 05:48:08 +03:00
890c9e87ce
* examples: plugins: utilize fal_embedded * libs: removed fnv1a_hash * furi: added FURI_PACKED; apps, libs: changed to use FURI_PACKED * lib: mbedtls: using custom config * lib: toolbox: removed md5, switched to mbedtls * targets: f18: link fix * lib: added mbedtls_cfg.h * apps: nfc: explicit dependency on libmbedtls * u2f: reworking to mbedtls * u2f: replaced sha256 & hmac with mbedtls * u2f: functional rework using mbedtls * libs: dropped micro-ecc * u2f: dropped old implementation * toolbox: removed sha256 impl * mcheck() for mbedtls * libs: removed libmisc; split into smaller libs * apps: debug: fixed display_test * apps: include cleanups * fbt: fixed VERSIONCOMSTR * furi: added FURI_CHECK_RETURN * lib: removed qrcode * cleanup * fbt: lint_py+format_py: fixed excessive command length * api: Removed bzero from f7 * api: Removed bzero from f18 * Bump API Symbols Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
61 lines
1.2 KiB
C
61 lines
1.2 KiB
C
#pragma once
|
|
|
|
#include "core_defines.h"
|
|
#include <stdbool.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include <cmsis_compiler.h>
|
|
|
|
#ifndef FURI_WARN_UNUSED
|
|
#define FURI_WARN_UNUSED __attribute__((warn_unused_result))
|
|
#endif
|
|
|
|
#ifndef FURI_WEAK
|
|
#define FURI_WEAK __attribute__((weak))
|
|
#endif
|
|
|
|
#ifndef FURI_PACKED
|
|
#define FURI_PACKED __attribute__((packed))
|
|
#endif
|
|
|
|
#ifndef FURI_IS_IRQ_MASKED
|
|
#define FURI_IS_IRQ_MASKED() (__get_PRIMASK() != 0U)
|
|
#endif
|
|
|
|
#ifndef FURI_IS_IRQ_MODE
|
|
#define FURI_IS_IRQ_MODE() (__get_IPSR() != 0U)
|
|
#endif
|
|
|
|
#ifndef FURI_IS_ISR
|
|
#define FURI_IS_ISR() (FURI_IS_IRQ_MODE() || FURI_IS_IRQ_MASKED())
|
|
#endif
|
|
|
|
typedef struct {
|
|
uint32_t isrm;
|
|
bool from_isr;
|
|
bool kernel_running;
|
|
} __FuriCriticalInfo;
|
|
|
|
__FuriCriticalInfo __furi_critical_enter(void);
|
|
|
|
void __furi_critical_exit(__FuriCriticalInfo info);
|
|
|
|
#ifndef FURI_CRITICAL_ENTER
|
|
#define FURI_CRITICAL_ENTER() __FuriCriticalInfo __furi_critical_info = __furi_critical_enter();
|
|
#endif
|
|
|
|
#ifndef FURI_CRITICAL_EXIT
|
|
#define FURI_CRITICAL_EXIT() __furi_critical_exit(__furi_critical_info);
|
|
#endif
|
|
|
|
#ifndef FURI_CHECK_RETURN
|
|
#define FURI_CHECK_RETURN __attribute__((__warn_unused_result__))
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|