mpconfigport.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #include <stdint.h>
  2. // options to control how MicroPython is built
  3. #define MICROPY_ALLOC_PATH_MAX (512)
  4. #define MICROPY_EMIT_X64 (0)
  5. #define MICROPY_EMIT_THUMB (1)
  6. #define MICROPY_EMIT_INLINE_THUMB (1)
  7. #define MICROPY_MALLOC_USES_ALLOCATED_SIZE (1)
  8. #define MICROPY_MEM_STATS (1)
  9. #define MICROPY_DEBUG_PRINTERS (0)
  10. #define MICROPY_ENABLE_GC (1)
  11. #define MICROPY_STACK_CHECK (1)
  12. #define MICROPY_HELPER_REPL (0)
  13. #define MICROPY_HELPER_LEXER_UNIX (0)
  14. #define MICROPY_ENABLE_SOURCE_LINE (1)
  15. #define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
  16. #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
  17. #define MICROPY_CAN_OVERRIDE_BUILTINS (1)
  18. #define MICROPY_WARNINGS (1)
  19. #define MICROPY_PY_ALL_SPECIAL_METHODS (1)
  20. #define MICROPY_PY_REVERSE_SPECIAL_METHODS (1)
  21. #define MICROPY_PY_ARRAY_SLICE_ASSIGN (1)
  22. #define MICROPY_PY_BUILTINS_FROZENSET (1)
  23. #define MICROPY_PY_BUILTINS_MEMORYVIEW (1)
  24. #define MICROPY_PY_BUILTINS_POW3 (1)
  25. #define MICROPY_PY_IO (1)
  26. #define MICROPY_PY_SYS_EXIT (1)
  27. #define MICROPY_PY_SYS_MAXSIZE (1)
  28. #define MICROPY_PY_UERRNO (1)
  29. #define MICROPY_PY_UBINASCII (1)
  30. #define MICROPY_PY_URANDOM (1)
  31. #define MICROPY_PY_UCTYPES (1)
  32. #define MICROPY_PY_UZLIB (1)
  33. #define MICROPY_PY_UJSON (1)
  34. #define MICROPY_PY_URE (1)
  35. #define MICROPY_PY_UHEAPQ (1)
  36. #define MICROPY_PY_UHASHLIB (1)
  37. #define MICROPY_PY_MACHINE (1)
  38. #define MICROPY_PY_MICROPYTHON_MEM_INFO (1)
  39. #define MICROPY_USE_INTERNAL_PRINTF (0)
  40. #define MICROPY_VFS (1)
  41. // type definitions for the specific machine
  42. #define MICROPY_MAKE_POINTER_CALLABLE(p) ((void*)((mp_uint_t)(p) | 1))
  43. #define MP_SSIZE_MAX (0x7fffffff)
  44. #define UINT_FMT "%lu"
  45. #define INT_FMT "%ld"
  46. typedef int32_t mp_int_t; // must be pointer size
  47. typedef uint32_t mp_uint_t; // must be pointer size
  48. typedef long mp_off_t;
  49. #include <unistd.h>
  50. #define MP_PLAT_PRINT_STRN(str, len) write(1, str, len)
  51. // extra built in names to add to the global namespace
  52. #define MICROPY_PORT_BUILTINS \
  53. { MP_ROM_QSTR(MP_QSTR_open), MP_ROM_PTR(&mp_builtin_open_obj) },
  54. // extra built-in modules to add to the list of known ones
  55. extern const struct _mp_obj_module_t mp_module_uos;
  56. #define MICROPY_PORT_BUILTIN_MODULES \
  57. { MP_ROM_QSTR(MP_QSTR_uos), MP_ROM_PTR(&mp_module_uos) }, \
  58. { MP_ROM_QSTR(MP_QSTR_umachine), MP_ROM_PTR(&mp_module_machine) }, \
  59. // We need to provide a declaration/definition of alloca()
  60. #include <alloca.h>
  61. #ifdef TEST
  62. #include "lib/upytesthelper/upytesthelper.h"
  63. #undef MP_PLAT_PRINT_STRN
  64. #define MP_PLAT_PRINT_STRN(str, len) upytest_output(str, len)
  65. #endif