mp_flipper_config.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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 (0)
  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_NONE)
  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_ENABLE_SOURCE_LINE (0)
  85. #define MICROPY_ENABLE_DOC_STRING (0)
  86. #define MICROPY_REPL_INFO (0)
  87. #define MICROPY_REPL_EMACS_KEYS (0)
  88. #define MICROPY_REPL_EMACS_WORDS_MOVE (0)
  89. #define MICROPY_REPL_EMACS_EXTRA_WORDS_MOVE (0)
  90. #define MICROPY_REPL_AUTO_INDENT (0)
  91. #define MICROPY_REPL_EVENT_DRIVEN (0)
  92. #define MICROPY_READLINE_HISTORY_SIZE (0)
  93. #define MICROPY_CPYTHON_COMPAT (1)
  94. #define MICROPY_FULL_CHECKS (0)
  95. #define MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG (0)
  96. #define MICROPY_MODULE_FROZEN_MPY (0)
  97. #define MICROPY_PY_CMATH (0)
  98. #define MICROPY_PY_BUILTINS_COMPLEX (0)
  99. #define MICROPY_MULTIPLE_INHERITANCE (0)
  100. #define MICROPY_MODULE_GETATTR (0)
  101. #define MICROPY_PY_FUNCTION_ATTRS (1)
  102. #define MICROPY_PY_DESCRIPTORS (0)
  103. #define MICROPY_PY_ASYNC_AWAIT (0)
  104. #define MICROPY_PY_ASSIGN_EXPR (0)
  105. #define MICROPY_PY_GENERATOR_PEND_THROW (0)
  106. #define MICROPY_PY_BUILTINS_BYTES_HEX (0)
  107. #define MICROPY_PY_BUILTINS_STR_UNICODE (0)
  108. #define MICROPY_PY_BUILTINS_STR_CENTER (0)
  109. #define MICROPY_PY_BUILTINS_STR_COUNT (0)
  110. #define MICROPY_PY_BUILTINS_STR_OP_MODULO (0)
  111. #define MICROPY_PY_BUILTINS_STR_PARTITION (0)
  112. #define MICROPY_PY_BUILTINS_STR_SPLITLINES (0)
  113. #define MICROPY_PY_BUILTINS_BYTEARRAY (0)
  114. #define MICROPY_PY_BUILTINS_DICT_FROMKEYS (0)
  115. #define MICROPY_PY_BUILTINS_MEMORYVIEW (0)
  116. #define MICROPY_PY_BUILTINS_SET (1)
  117. #define MICROPY_PY_BUILTINS_SLICE (0)
  118. #define MICROPY_PY_BUILTINS_SLICE_ATTRS (0)
  119. #define MICROPY_PY_BUILTINS_SLICE_INDICES (0)
  120. #define MICROPY_PY_BUILTINS_FROZENSET (0)
  121. #define MICROPY_PY_BUILTINS_PROPERTY (0)
  122. #define MICROPY_PY_BUILTINS_RANGE_ATTRS (0)
  123. #define MICROPY_PY_BUILTINS_RANGE_BINOP (0)
  124. #define MICROPY_PY_BUILTINS_NEXT2 (0)
  125. #define MICROPY_PY_BUILTINS_ROUND_INT (0)
  126. #define MICROPY_PY_ALL_SPECIAL_METHODS (0)
  127. #define MICROPY_PY_REVERSE_SPECIAL_METHODS (0)
  128. #define MICROPY_PY_BUILTINS_ENUMERATE (0)
  129. #define MICROPY_PY_BUILTINS_COMPILE (0)
  130. #define MICROPY_PY_BUILTINS_EVAL_EXEC (0)
  131. #define MICROPY_PY_BUILTINS_EXECFILE (0)
  132. #define MICROPY_PY_BUILTINS_FILTER (1)
  133. #define MICROPY_PY_BUILTINS_REVERSED (1)
  134. #define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (0)
  135. #define MICROPY_PY_BUILTINS_INPUT (0)
  136. #define MICROPY_PY_BUILTINS_MIN_MAX (1)
  137. #define MICROPY_PY_BUILTINS_POW3 (0)
  138. #define MICROPY_PY_BUILTINS_HELP (0)
  139. #define MICROPY_PY_MICROPYTHON (0)
  140. #define MICROPY_PY_MICROPYTHON_MEM_INFO (0)
  141. #define MICROPY_PY_MICROPYTHON_STACK_USE (0)
  142. #define MICROPY_PY_MICROPYTHON_HEAP_LOCKED (0)
  143. #define MICROPY_PY_ARRAY (0)
  144. #define MICROPY_PY_ARRAY_SLICE_ASSIGN (0)
  145. #define MICROPY_PY_ATTRTUPLE (0)
  146. #define MICROPY_PY_COLLECTIONS (0)
  147. #define MICROPY_PY_STRUCT (0)
  148. #define MICROPY_PY_GC (0)
  149. #define MICROPY_PY_SYS (0)
  150. #define MICROPY_PY_SYS_MODULES (0)
  151. #define MICROPY_PY_SELECT_SELECT (0)
  152. #define MICROPY_PY_SYS_EXIT (0)
  153. #define MICROPY_PY_RE (0)
  154. #define MICROPY_PY_CRYPTOLIB (0)
  155. #define MICROPY_PY_VFS (0)
  156. #define MICROPY_ENABLE_SCHEDULER (1)
  157. #define MICROPY_MODULE_BUILTIN_INIT (1)
  158. #ifdef MP_FLIPPER_MATH
  159. #define MICROPY_PY_MATH (1)
  160. #else
  161. #define MICROPY_PY_MATH (0)
  162. #endif
  163. #ifdef MP_FLIPPER_IO
  164. #define MICROPY_PY_IO (1)
  165. #else
  166. #define MICROPY_PY_IO (0)
  167. #endif
  168. #ifdef MP_FLIPPER_JSON
  169. #define MICROPY_PY_JSON (1)
  170. #define MICROPY_PY_JSON_SEPARATORS (1)
  171. #else
  172. #define MICROPY_PY_JSON (0)
  173. #define MICROPY_PY_JSON_SEPARATORS (0)
  174. #endif
  175. #define MICROPY_COMP_CONST_FOLDING (0)
  176. #define MICROPY_COMP_CONST_TUPLE (0)
  177. #define MICROPY_COMP_CONST_LITERAL (0)
  178. #define MICROPY_COMP_CONST (0)
  179. #define MICROPY_COMP_DOUBLE_TUPLE_ASSIGN (0)