|
| 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 | + |
| 28 | +// Include Zephyr's autoconf.h, which should be made first by Zephyr makefiles |
| 29 | +#include "autoconf.h" |
| 30 | + |
| 31 | +// Usually passed from Makefile |
| 32 | +#ifndef MICROPY_HEAP_SIZE |
| 33 | +#define MICROPY_HEAP_SIZE (16 * 1024) |
| 34 | +#endif |
| 35 | + |
| 36 | +#define MICROPY_STACK_CHECK (1) |
| 37 | +#define MICROPY_ENABLE_GC (1) |
| 38 | +#define MICROPY_HELPER_REPL (1) |
| 39 | +#define MICROPY_REPL_AUTO_INDENT (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 | + |
| 61 | +// Saving extra crumbs to make sure binary fits in 128K |
| 62 | +#define MICROPY_COMP_CONST_FOLDING (0) |
| 63 | +#define MICROPY_COMP_CONST (0) |
| 64 | +#define MICROPY_COMP_DOUBLE_TUPLE_ASSIGN (0) |
| 65 | + |
| 66 | +#ifdef CONFIG_BOARD |
| 67 | +#define MICROPY_HW_BOARD_NAME "zephyr-" CONFIG_BOARD |
| 68 | +#else |
| 69 | +#define MICROPY_HW_BOARD_NAME "zephyr-generic" |
| 70 | +#endif |
| 71 | + |
| 72 | +#ifdef CONFIG_SOC |
| 73 | +#define MICROPY_HW_MCU_NAME CONFIG_SOC |
| 74 | +#else |
| 75 | +#define MICROPY_HW_MCU_NAME "unknown-cpu" |
| 76 | +#endif |
| 77 | + |
| 78 | +typedef int mp_int_t; // must be pointer size |
| 79 | +typedef unsigned mp_uint_t; // must be pointer size |
| 80 | + |
| 81 | +typedef void *machine_ptr_t; // must be of pointer size |
| 82 | +typedef const void *machine_const_ptr_t; // must be of pointer size |
| 83 | +typedef long mp_off_t; |
| 84 | + |
| 85 | +#define BYTES_PER_WORD (sizeof(mp_int_t)) |
| 86 | + |
| 87 | +#define MP_STATE_PORT MP_STATE_VM |
| 88 | + |
| 89 | +#define MICROPY_PORT_ROOT_POINTERS \ |
| 90 | + mp_obj_t mp_kbd_exception; \ |
| 91 | + const char *readline_hist[8]; |
0 commit comments