blob: dcd9407f8293c1c24a2f2ef44fdf2336afe8547e [file] [log] [blame]
Damien George075d5972014-11-27 20:30:33 +00001#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)
Paul Sokolovskyf12ea7c2015-01-16 01:54:40 +020012#define MICROPY_STACK_CHECK (0)
13#define MICROPY_REPL_EVENT_DRIVEN (1)
Damien George075d5972014-11-27 20:30:33 +000014#define MICROPY_HELPER_REPL (1)
15#define MICROPY_HELPER_LEXER_UNIX (0)
16#define MICROPY_ENABLE_SOURCE_LINE (1)
17#define MICROPY_PY_BUILTINS_STR_UNICODE (1)
18#define MICROPY_PY_BUILTINS_BYTEARRAY (1)
19#define MICROPY_PY_BUILTINS_MEMORYVIEW (1)
20#define MICROPY_PY_BUILTINS_FROZENSET (1)
21#define MICROPY_PY_BUILTINS_SET (1)
22#define MICROPY_PY_BUILTINS_SLICE (1)
23#define MICROPY_PY_BUILTINS_PROPERTY (1)
24#define MICROPY_PY___FILE__ (0)
25#define MICROPY_PY_GC (1)
26#define MICROPY_PY_ARRAY (1)
27#define MICROPY_PY_COLLECTIONS (1)
28#define MICROPY_PY_MATH (0)
29#define MICROPY_PY_CMATH (0)
30#define MICROPY_PY_IO (1)
31#define MICROPY_PY_STRUCT (1)
32#define MICROPY_PY_SYS (1)
33#define MICROPY_PY_SYS_EXIT (1)
34#define MICROPY_PY_SYS_STDFILES (1)
35#define MICROPY_CPYTHON_COMPAT (0)
Damien Georgefbea8102014-11-28 14:58:25 +000036#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_LONGLONG)
Damien George075d5972014-11-27 20:30:33 +000037#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_NONE)
38#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_TERSE)
39
40// type definitions for the specific machine
41
42#define BYTES_PER_WORD (4)
43
44#define MICROPY_MAKE_POINTER_CALLABLE(p) ((void*)((mp_uint_t)(p)))
45
46#define UINT_FMT "%u"
47#define INT_FMT "%d"
48
49typedef int32_t mp_int_t; // must be pointer size
50typedef uint32_t mp_uint_t; // must be pointer size
51typedef void *machine_ptr_t; // must be of pointer size
52typedef const void *machine_const_ptr_t; // must be of pointer size
53typedef long mp_off_t;
54
Damien George7f9d1d62015-04-09 23:56:15 +010055void mp_hal_stdout_tx_strn_cooked(const char *str, mp_uint_t len);
56#define MP_PLAT_PRINT_STRN(str, len) mp_hal_stdout_tx_strn_cooked(str, len)
57
Damien George075d5972014-11-27 20:30:33 +000058// extra built in names to add to the global namespace
59extern const struct _mp_obj_fun_builtin_t mp_builtin_open_obj;
60#define MICROPY_PORT_BUILTINS \
61 { MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj },
62
63// extra built in modules to add to the list of known ones
64extern const struct _mp_obj_module_t pyb_module;
Paul Sokolovsky6ec650b2015-01-23 00:34:16 +020065extern const struct _mp_obj_module_t esp_module;
Damien George075d5972014-11-27 20:30:33 +000066
67#define MICROPY_PORT_BUILTIN_MODULES \
68 { MP_OBJ_NEW_QSTR(MP_QSTR_pyb), (mp_obj_t)&pyb_module }, \
Paul Sokolovsky6ec650b2015-01-23 00:34:16 +020069 { MP_OBJ_NEW_QSTR(MP_QSTR_esp), (mp_obj_t)&esp_module }, \
Damien George075d5972014-11-27 20:30:33 +000070
Damien George3b51b3e2015-01-07 23:38:50 +000071#define MP_STATE_PORT MP_STATE_VM
72
73#define MICROPY_PORT_ROOT_POINTERS \
74 const char *readline_hist[8];
75
Damien George075d5972014-11-27 20:30:33 +000076// We need to provide a declaration/definition of alloca()
77#include <alloca.h>
78
79// board specifics
80
81#define MICROPY_HAL_H "esp_mphal.h"
82#define MICROPY_HW_BOARD_NAME "ESP module"
83#define MICROPY_HW_MCU_NAME "ESP8266"