Damien George | 075d597 | 2014-11-27 20:30:33 +0000 | [diff] [blame^] | 1 | #include <stdint.h> |
| 2 | |
| 3 | // options to control how Micro Python is built |
| 4 | |
| 5 | #define MICROPY_ALLOC_PATH_MAX (128) |
| 6 | #define MICROPY_EMIT_X64 (0) |
| 7 | #define MICROPY_EMIT_THUMB (0) |
| 8 | #define MICROPY_EMIT_INLINE_THUMB (0) |
| 9 | #define MICROPY_MEM_STATS (0) |
| 10 | #define MICROPY_DEBUG_PRINTERS (0) |
| 11 | #define MICROPY_ENABLE_GC (1) |
| 12 | #define MICROPY_HELPER_REPL (1) |
| 13 | #define MICROPY_HELPER_LEXER_UNIX (0) |
| 14 | #define MICROPY_ENABLE_SOURCE_LINE (1) |
| 15 | #define MICROPY_PY_BUILTINS_STR_UNICODE (1) |
| 16 | #define MICROPY_PY_BUILTINS_BYTEARRAY (1) |
| 17 | #define MICROPY_PY_BUILTINS_MEMORYVIEW (1) |
| 18 | #define MICROPY_PY_BUILTINS_FROZENSET (1) |
| 19 | #define MICROPY_PY_BUILTINS_SET (1) |
| 20 | #define MICROPY_PY_BUILTINS_SLICE (1) |
| 21 | #define MICROPY_PY_BUILTINS_PROPERTY (1) |
| 22 | #define MICROPY_PY___FILE__ (0) |
| 23 | #define MICROPY_PY_GC (1) |
| 24 | #define MICROPY_PY_ARRAY (1) |
| 25 | #define MICROPY_PY_COLLECTIONS (1) |
| 26 | #define MICROPY_PY_MATH (0) |
| 27 | #define MICROPY_PY_CMATH (0) |
| 28 | #define MICROPY_PY_IO (1) |
| 29 | #define MICROPY_PY_STRUCT (1) |
| 30 | #define MICROPY_PY_SYS (1) |
| 31 | #define MICROPY_PY_SYS_EXIT (1) |
| 32 | #define MICROPY_PY_SYS_STDFILES (1) |
| 33 | #define MICROPY_CPYTHON_COMPAT (0) |
| 34 | #define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ) |
| 35 | #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_NONE) |
| 36 | #define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_TERSE) |
| 37 | |
| 38 | // type definitions for the specific machine |
| 39 | |
| 40 | #define BYTES_PER_WORD (4) |
| 41 | |
| 42 | #define MICROPY_MAKE_POINTER_CALLABLE(p) ((void*)((mp_uint_t)(p))) |
| 43 | |
| 44 | #define UINT_FMT "%u" |
| 45 | #define INT_FMT "%d" |
| 46 | |
| 47 | typedef int32_t mp_int_t; // must be pointer size |
| 48 | typedef uint32_t mp_uint_t; // must be pointer size |
| 49 | typedef void *machine_ptr_t; // must be of pointer size |
| 50 | typedef const void *machine_const_ptr_t; // must be of pointer size |
| 51 | typedef long mp_off_t; |
| 52 | |
| 53 | // extra built in names to add to the global namespace |
| 54 | extern const struct _mp_obj_fun_builtin_t mp_builtin_open_obj; |
| 55 | #define MICROPY_PORT_BUILTINS \ |
| 56 | { MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj }, |
| 57 | |
| 58 | // extra built in modules to add to the list of known ones |
| 59 | extern const struct _mp_obj_module_t pyb_module; |
| 60 | |
| 61 | #define MICROPY_PORT_BUILTIN_MODULES \ |
| 62 | { MP_OBJ_NEW_QSTR(MP_QSTR_pyb), (mp_obj_t)&pyb_module }, \ |
| 63 | |
| 64 | // We need to provide a declaration/definition of alloca() |
| 65 | #include <alloca.h> |
| 66 | |
| 67 | // board specifics |
| 68 | |
| 69 | #define MICROPY_HAL_H "esp_mphal.h" |
| 70 | #define MICROPY_HW_BOARD_NAME "ESP module" |
| 71 | #define MICROPY_HW_MCU_NAME "ESP8266" |