mpconfigport_minimal.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * This file is part of the MicroPython project, http://micropython.org/
  3. *
  4. * The MIT License (MIT)
  5. *
  6. * Copyright (c) 2016 Linaro Limited
  7. *
  8. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9. * of this software and associated documentation files (the "Software"), to deal
  10. * in the Software without restriction, including without limitation the rights
  11. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12. * copies of the Software, and to permit persons to whom the Software is
  13. * furnished to do so, subject to the following conditions:
  14. *
  15. * The above copyright notice and this permission notice shall be included in
  16. * all copies or substantial portions of the Software.
  17. *
  18. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  23. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  24. * THE SOFTWARE.
  25. */
  26. #include <alloca.h>
  27. // Include Zephyr's autoconf.h, which should be made first by Zephyr makefiles
  28. #include "autoconf.h"
  29. // Included here to get basic Zephyr environment (macros, etc.)
  30. #include <zephyr.h>
  31. // Usually passed from Makefile
  32. #ifndef MICROPY_HEAP_SIZE
  33. #define MICROPY_HEAP_SIZE (16 * 1024)
  34. #endif
  35. #define MICROPY_STACK_CHECK (1)
  36. #define MICROPY_ENABLE_GC (1)
  37. #define MICROPY_HELPER_REPL (1)
  38. #define MICROPY_REPL_AUTO_INDENT (1)
  39. #define MICROPY_KBD_EXCEPTION (1)
  40. #define MICROPY_CPYTHON_COMPAT (0)
  41. #define MICROPY_PY_ASYNC_AWAIT (0)
  42. #define MICROPY_PY_ATTRTUPLE (0)
  43. #define MICROPY_PY_BUILTINS_ENUMERATE (0)
  44. #define MICROPY_PY_BUILTINS_FILTER (0)
  45. #define MICROPY_PY_BUILTINS_MIN_MAX (0)
  46. #define MICROPY_PY_BUILTINS_PROPERTY (0)
  47. #define MICROPY_PY_BUILTINS_RANGE_ATTRS (0)
  48. #define MICROPY_PY_BUILTINS_REVERSED (0)
  49. #define MICROPY_PY_BUILTINS_SET (0)
  50. #define MICROPY_PY_BUILTINS_SLICE (0)
  51. #define MICROPY_PY_ARRAY (0)
  52. #define MICROPY_PY_COLLECTIONS (0)
  53. #define MICROPY_PY_CMATH (0)
  54. #define MICROPY_PY_IO (0)
  55. #define MICROPY_PY_STRUCT (0)
  56. #define MICROPY_PY_SYS_MODULES (0)
  57. #define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_LONGLONG)
  58. #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
  59. #define MICROPY_PY_BUILTINS_COMPLEX (0)
  60. // Saving extra crumbs to make sure binary fits in 128K
  61. #define MICROPY_COMP_CONST_FOLDING (0)
  62. #define MICROPY_COMP_CONST (0)
  63. #define MICROPY_COMP_DOUBLE_TUPLE_ASSIGN (0)
  64. #ifdef CONFIG_BOARD
  65. #define MICROPY_HW_BOARD_NAME "zephyr-" CONFIG_BOARD
  66. #else
  67. #define MICROPY_HW_BOARD_NAME "zephyr-generic"
  68. #endif
  69. #ifdef CONFIG_SOC
  70. #define MICROPY_HW_MCU_NAME CONFIG_SOC
  71. #else
  72. #define MICROPY_HW_MCU_NAME "unknown-cpu"
  73. #endif
  74. typedef int mp_int_t; // must be pointer size
  75. typedef unsigned mp_uint_t; // must be pointer size
  76. typedef long mp_off_t;
  77. #define MP_STATE_PORT MP_STATE_VM
  78. #define MICROPY_PORT_ROOT_POINTERS \
  79. const char *readline_hist[8];