base.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #pragma once
  2. #include <stdint.h>
  3. #include <stdbool.h>
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. typedef enum {
  8. FuriWaitForever = 0xFFFFFFFFU,
  9. } FuriWait;
  10. typedef enum {
  11. FuriFlagWaitAny = 0x00000000U, ///< Wait for any flag (default).
  12. FuriFlagWaitAll = 0x00000001U, ///< Wait for all flags.
  13. FuriFlagNoClear = 0x00000002U, ///< Do not clear flags which have been specified to wait for.
  14. FuriFlagError = 0x80000000U, ///< Error indicator.
  15. FuriFlagErrorUnknown = 0xFFFFFFFFU, ///< FuriStatusError (-1).
  16. FuriFlagErrorTimeout = 0xFFFFFFFEU, ///< FuriStatusErrorTimeout (-2).
  17. FuriFlagErrorResource = 0xFFFFFFFDU, ///< FuriStatusErrorResource (-3).
  18. FuriFlagErrorParameter = 0xFFFFFFFCU, ///< FuriStatusErrorParameter (-4).
  19. FuriFlagErrorISR = 0xFFFFFFFAU, ///< FuriStatusErrorISR (-6).
  20. } FuriFlag;
  21. typedef enum {
  22. FuriStatusOk = 0, ///< Operation completed successfully.
  23. FuriStatusError =
  24. -1, ///< Unspecified RTOS error: run-time error but no other error message fits.
  25. FuriStatusErrorTimeout = -2, ///< Operation not completed within the timeout period.
  26. FuriStatusErrorResource = -3, ///< Resource not available.
  27. FuriStatusErrorParameter = -4, ///< Parameter error.
  28. FuriStatusErrorNoMemory =
  29. -5, ///< System is out of memory: it was impossible to allocate or reserve memory for the operation.
  30. FuriStatusErrorISR =
  31. -6, ///< Not allowed in ISR context: the function cannot be called from interrupt service routines.
  32. FuriStatusReserved = 0x7FFFFFFF ///< Prevents enum down-size compiler optimization.
  33. } FuriStatus;
  34. #ifdef __cplusplus
  35. }
  36. #endif