2014-04-16 16:27:23 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2017-06-30 07:22:17 +00:00
|
|
|
// options to control how MicroPython is built
|
2014-04-16 16:27:23 +00:00
|
|
|
|
2024-01-29 01:46:03 +00:00
|
|
|
#define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES)
|
2021-05-25 12:16:08 +00:00
|
|
|
|
|
|
|
#if defined(__ARM_ARCH_ISA_ARM)
|
|
|
|
#define MICROPY_EMIT_ARM (1)
|
|
|
|
#define MICROPY_EMIT_INLINE_THUMB (1)
|
|
|
|
#elif defined(__ARM_ARCH_ISA_THUMB)
|
2015-01-12 12:07:42 +00:00
|
|
|
#define MICROPY_EMIT_THUMB (1)
|
|
|
|
#define MICROPY_EMIT_INLINE_THUMB (1)
|
2021-05-25 12:16:08 +00:00
|
|
|
#define MICROPY_MAKE_POINTER_CALLABLE(p) ((void *)((mp_uint_t)(p) | 1))
|
|
|
|
#endif
|
|
|
|
|
2017-06-05 21:23:05 +00:00
|
|
|
#define MICROPY_MALLOC_USES_ALLOCATED_SIZE (1)
|
|
|
|
#define MICROPY_MEM_STATS (1)
|
2015-01-12 12:07:42 +00:00
|
|
|
#define MICROPY_ENABLE_GC (1)
|
2024-01-29 01:46:03 +00:00
|
|
|
#define MICROPY_KBD_EXCEPTION (0)
|
2014-05-21 19:32:59 +00:00
|
|
|
#define MICROPY_HELPER_REPL (0)
|
2015-01-09 00:03:21 +00:00
|
|
|
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
|
2016-11-03 01:28:31 +00:00
|
|
|
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
|
2017-12-11 18:04:27 +00:00
|
|
|
#define MICROPY_WARNINGS (1)
|
2024-01-29 01:46:03 +00:00
|
|
|
#define MICROPY_PY_BUILTINS_INPUT (0)
|
|
|
|
#define MICROPY_PY_BUILTINS_HELP (0)
|
|
|
|
#define MICROPY_PY_IO_IOBASE (0)
|
2022-04-28 06:51:49 +00:00
|
|
|
#define MICROPY_PY_SYS_PLATFORM "qemu-arm"
|
2024-01-29 01:46:03 +00:00
|
|
|
#define MICROPY_PY_SYS_STDFILES (0)
|
|
|
|
#define MICROPY_PY_SYS_STDIO_BUFFER (0)
|
|
|
|
#define MICROPY_PY_SELECT (0)
|
|
|
|
#define MICROPY_PY_TIME (0)
|
|
|
|
#define MICROPY_PY_ASYNCIO (0)
|
2017-03-02 05:39:58 +00:00
|
|
|
#define MICROPY_PY_MACHINE (1)
|
extmod/modmachine: Factor ports' machine module dict to common code.
This is a code factoring to have the dict for the machine module in one
location, and all the ports use that same dict. The machine.soft_reset()
function implementation is also factored because it's the same for all
ports that did already implement it. Eventually more functions/bindings
can be factored.
All ports remain functionally the same, except:
- cc3200 port: gains soft_reset, mem8, mem16, mem32, Signal; loses POWER_ON
(which was a legacy constant, replaced long ago by PWRON_RESET)
- nrf port: gains Signal
- qemu-arm port: gains soft_reset
- unix port: gains soft_reset
- zephyr port: gains soft_reset, mem8, mem16, mem32
Signed-off-by: Damien George <damien@micropython.org>
2023-11-22 02:00:02 +00:00
|
|
|
#define MICROPY_PY_MACHINE_INCLUDEFILE "ports/qemu-arm/modmachine.c"
|
2023-11-23 22:35:42 +00:00
|
|
|
#define MICROPY_PY_MACHINE_PIN_BASE (1)
|
2017-03-13 10:24:21 +00:00
|
|
|
#define MICROPY_VFS (1)
|
2014-04-16 16:27:23 +00:00
|
|
|
|
|
|
|
// type definitions for the specific machine
|
|
|
|
|
2015-04-04 21:04:53 +00:00
|
|
|
#define MP_SSIZE_MAX (0x7fffffff)
|
|
|
|
|
2014-04-16 16:27:23 +00:00
|
|
|
#define UINT_FMT "%lu"
|
|
|
|
#define INT_FMT "%ld"
|
|
|
|
|
2014-07-03 12:25:24 +00:00
|
|
|
typedef int32_t mp_int_t; // must be pointer size
|
|
|
|
typedef uint32_t mp_uint_t; // must be pointer size
|
2014-11-16 22:16:14 +00:00
|
|
|
typedef long mp_off_t;
|
2014-04-16 16:27:23 +00:00
|
|
|
|
2014-06-08 12:25:33 +00:00
|
|
|
// We need to provide a declaration/definition of alloca()
|
|
|
|
#include <alloca.h>
|
2017-12-11 18:04:27 +00:00
|
|
|
|
2024-01-29 01:46:03 +00:00
|
|
|
// We need an implementation of the log2 function which is not a macro.
|
|
|
|
#define MP_NEED_LOG2 (1)
|
|
|
|
|
2017-12-11 18:04:27 +00:00
|
|
|
#ifdef TEST
|
2021-07-09 04:19:15 +00:00
|
|
|
#include "shared/upytesthelper/upytesthelper.h"
|
2017-12-11 18:04:27 +00:00
|
|
|
#undef MP_PLAT_PRINT_STRN
|
|
|
|
#define MP_PLAT_PRINT_STRN(str, len) upytest_output(str, len)
|
|
|
|
#endif
|