mp_flipper_config.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. // Need to provide a declaration/definition of alloca()
  2. #if defined(__FreeBSD__) || defined(__NetBSD__)
  3. #include <stdlib.h>
  4. #else
  5. #include <alloca.h>
  6. #endif
  7. #include <stdint.h>
  8. #ifndef MP_FLIPPER_IS_COMPILER
  9. #ifndef MP_FLIPPER_COMPILER
  10. #define MP_FLIPPER_IS_COMPILER (0)
  11. #else
  12. #define MP_FLIPPER_IS_COMPILER (1)
  13. #endif
  14. #endif
  15. #ifndef MP_FLIPPER_IS_RUNTIME
  16. #ifndef MP_FLIPPER_RUNTIME
  17. #define MP_FLIPPER_IS_RUNTIME (0)
  18. #else
  19. #define MP_FLIPPER_IS_RUNTIME (1)
  20. #endif
  21. #endif
  22. // Type definitions for the specific machine
  23. typedef int32_t mp_int_t; // must be pointer size
  24. typedef uint32_t mp_uint_t; // must be pointer size
  25. typedef long mp_off_t;
  26. #ifdef MP_FLIPPER_SPLIT_HEAP
  27. #define MICROPY_GC_SPLIT_HEAP (1)
  28. #define MICROPY_GC_SPLIT_HEAP_AUTO (1)
  29. #endif
  30. #define MICROPY_MPHALPORT_H "mp_flipper_halport.h"
  31. #define MICROPY_MIN_USE_CORTEX_CPU (1)
  32. #define MICROPY_MIN_USE_STM32_MCU (1)
  33. #define MICROPY_HW_BOARD_NAME "Flipper Zero"
  34. #define MICROPY_HW_MCU_NAME "STM32WB55RG"
  35. #define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_CORE_FEATURES)
  36. #ifdef MP_FLIPPER_MPY_SUPPORT
  37. #define MICROPY_PERSISTENT_CODE_LOAD (MP_FLIPPER_IS_RUNTIME)
  38. #define MICROPY_PERSISTENT_CODE_SAVE (MP_FLIPPER_IS_COMPILER)
  39. #else
  40. #define MICROPY_PERSISTENT_CODE_LOAD (0)
  41. #define MICROPY_PERSISTENT_CODE_SAVE (0)
  42. #endif
  43. #define MICROPY_PERSISTENT_CODE_SAVE_FILE (0)
  44. #define MICROPY_ENABLE_COMPILER (MP_FLIPPER_IS_COMPILER)
  45. #define MICROPY_ENABLE_GC (1)
  46. #define MICROPY_PY_GC_COLLECT_RETVAL (1)
  47. #define MICROPY_ENABLE_PYSTACK (0)
  48. #define MICROPY_STACK_CHECK (1)
  49. #define MICROPY_ALLOC_PATH_MAX (256)
  50. #define MICROPY_ENABLE_FINALISER (0)
  51. #ifdef MP_FLIPPER_FIRMWARE
  52. #define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_TERSE)
  53. #else
  54. #define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_NONE)
  55. #endif
  56. #define MICROPY_GC_STACK_ENTRY_TYPE uint32_t
  57. #define MICROPY_PY___FILE__ (1)
  58. #define MICROPY_ENABLE_EXTERNAL_IMPORT (1)
  59. #define MICROPY_READER_VFS (1)
  60. #define MICROPY_ENABLE_VM_ABORT (0)
  61. #define MICROPY_PY_ERRNO (0)
  62. #define MICROPY_USE_INTERNAL_ERRNO (0)
  63. #define MICROPY_PY_ERRNO_ERRORCODE (0)
  64. #define MICROPY_PY_TIME (1)
  65. #define MICROPY_PY_TIME_TIME_TIME_NS (1)
  66. #define MICROPY_PY_RANDOM (1)
  67. #define MICROPY_PY_RANDOM_EXTRA_FUNCS (1)
  68. #define MICROPY_PY_RANDOM_SEED_INIT_FUNC (mp_flipper_seed_init())
  69. #ifdef MP_FLIPPER_FIRMWARE
  70. #define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_LONGLONG)
  71. #else
  72. #define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
  73. #endif
  74. #ifdef MP_FLIPPER_FIRMWARE
  75. #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_DOUBLE)
  76. #else
  77. #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
  78. #endif
  79. #ifdef MP_FLIPPER_FIRMWARE
  80. #define MICROPY_HELPER_REPL (MP_FLIPPER_IS_COMPILER)
  81. #else
  82. #define MICROPY_HELPER_REPL (0)
  83. #endif
  84. #define MICROPY_REPL_INFO (0)
  85. #define MICROPY_REPL_EMACS_KEYS (0)
  86. #define MICROPY_REPL_EMACS_WORDS_MOVE (0)
  87. #define MICROPY_REPL_EMACS_EXTRA_WORDS_MOVE (0)
  88. #define MICROPY_REPL_AUTO_INDENT (0)
  89. #define MICROPY_REPL_EVENT_DRIVEN (0)
  90. #define MICROPY_READLINE_HISTORY_SIZE (0)
  91. #define MICROPY_CPYTHON_COMPAT (1)
  92. #define MICROPY_FULL_CHECKS (1)
  93. #define MICROPY_MODULE_FROZEN_MPY (0)
  94. #define MICROPY_PY_CMATH (0)
  95. #define MICROPY_PY_BUILTINS_COMPLEX (0)
  96. #define MICROPY_MULTIPLE_INHERITANCE (0)
  97. #define MICROPY_PY_FUNCTION_ATTRS (1)
  98. #define MICROPY_PY_DESCRIPTORS (0)
  99. #define MICROPY_PY_ASYNC_AWAIT (0)
  100. #define MICROPY_PY_ASSIGN_EXPR (0)
  101. #define MICROPY_PY_GENERATOR_PEND_THROW (0)
  102. #define MICROPY_PY_BUILTINS_COMPILE (0)
  103. #define MICROPY_PY_BUILTINS_EVAL_EXEC (0)
  104. #define MICROPY_PY_BUILTINS_EXECFILE (0)
  105. #define MICROPY_PY_BUILTINS_INPUT (0)
  106. #define MICROPY_PY_COLLECTIONS (0)
  107. #define MICROPY_PY_STRUCT (0)
  108. #define MICROPY_PY_SYS (0)
  109. #define MICROPY_PY_SYS_MODULES (0)
  110. #define MICROPY_PY_SELECT_SELECT (0)
  111. #define MICROPY_PY_RE (0)
  112. #define MICROPY_PY_CRYPTOLIB (0)
  113. #define MICROPY_PY_VFS (0)
  114. #define MICROPY_ENABLE_SCHEDULER (1)
  115. #define MICROPY_MODULE_BUILTIN_INIT (1)
  116. #ifdef MP_FLIPPER_MATH
  117. #define MICROPY_PY_MATH (1)
  118. #else
  119. #define MICROPY_PY_MATH (0)
  120. #endif
  121. #ifdef MP_FLIPPER_IO
  122. #define MICROPY_PY_IO (1)
  123. #else
  124. #define MICROPY_PY_IO (0)
  125. #endif
  126. #ifdef MP_FLIPPER_JSON
  127. #define MICROPY_PY_JSON (1)
  128. #else
  129. #define MICROPY_PY_JSON (0)
  130. #endif