unleashed-firmware/furi/core/base.h
Georgii Surkov 4cf98867a0
[FL-3847, FL-3513] Thread Signals (#3730)
* Add signal API
* Add signal support to loader
* Add signal support to ViewDispatcher
* Remove extra signal definitions
* Fix typos
  Co-authored-by: Silent <CookiePLMonster@users.noreply.github.com>
* scripts: runfap: close current app pre-launch
* loader: enable backlight when starting an app
* scripts: removed distfap.py
* Do not expose signal API via ViewDispatcher
* scripts: runfap: iterative retry to launch
* Add a loader signal subcommand
* Furi, Gui: move signal handling from View Dispatcher to Event Loop

Co-authored-by: Silent <CookiePLMonster@users.noreply.github.com>
Co-authored-by: hedger <hedger@nanode.su>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2024-06-21 21:44:36 +01:00

52 lines
1.8 KiB
C

#pragma once
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include <furi_config.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
FuriWaitForever = 0xFFFFFFFFU,
} FuriWait;
typedef enum {
FuriFlagWaitAny = 0x00000000U, ///< Wait for any flag (default).
FuriFlagWaitAll = 0x00000001U, ///< Wait for all flags.
FuriFlagNoClear = 0x00000002U, ///< Do not clear flags which have been specified to wait for.
FuriFlagError = 0x80000000U, ///< Error indicator.
FuriFlagErrorUnknown = 0xFFFFFFFFU, ///< FuriStatusError (-1).
FuriFlagErrorTimeout = 0xFFFFFFFEU, ///< FuriStatusErrorTimeout (-2).
FuriFlagErrorResource = 0xFFFFFFFDU, ///< FuriStatusErrorResource (-3).
FuriFlagErrorParameter = 0xFFFFFFFCU, ///< FuriStatusErrorParameter (-4).
FuriFlagErrorISR = 0xFFFFFFFAU, ///< FuriStatusErrorISR (-6).
} FuriFlag;
typedef enum {
FuriStatusOk = 0, ///< Operation completed successfully.
FuriStatusError =
-1, ///< Unspecified RTOS error: run-time error but no other error message fits.
FuriStatusErrorTimeout = -2, ///< Operation not completed within the timeout period.
FuriStatusErrorResource = -3, ///< Resource not available.
FuriStatusErrorParameter = -4, ///< Parameter error.
FuriStatusErrorNoMemory =
-5, ///< System is out of memory: it was impossible to allocate or reserve memory for the operation.
FuriStatusErrorISR =
-6, ///< Not allowed in ISR context: the function cannot be called from interrupt service routines.
FuriStatusReserved = 0x7FFFFFFF ///< Prevents enum down-size compiler optimization.
} FuriStatus;
typedef enum {
FuriSignalExit, /**< Request (graceful) exit. */
// Other standard signals may be added in the future
FuriSignalCustom = 100, /**< Custom signal values start from here. */
} FuriSignal;
#ifdef __cplusplus
}
#endif