summaryrefslogtreecommitdiff
path: root/qemu-arm
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2017-08-25 22:17:07 -0400
committerDan Halbert <halbert@halwitz.org>2017-08-25 22:17:07 -0400
commitef61b5ecb59e9b4e37e3e3c023c62d583c23eb16 (patch)
tree45a798fbed0dc673304597b29e0b60174195ce79 /qemu-arm
parent266be307770abe11c220eb493388807920914b7a (diff)
parent1f78e7a43130acfa4bedf16c1007a1b0f37c75c3 (diff)
Initial merge of micropython v1.9.2 into circuitpython 2.0.0 (in development) master.
cpx build compiles and loads and works in repl; test suite not run yet esp8266 not tested yet
Diffstat (limited to 'qemu-arm')
-rw-r--r--qemu-arm/Makefile20
-rw-r--r--qemu-arm/mpconfigport.h4
2 files changed, 10 insertions, 14 deletions
diff --git a/qemu-arm/Makefile b/qemu-arm/Makefile
index 07aa68572..71403cb5e 100644
--- a/qemu-arm/Makefile
+++ b/qemu-arm/Makefile
@@ -5,14 +5,14 @@ include ../py/mkenv.mk
QSTR_DEFS = qstrdefsport.h
# include py core make definitions
-include ../py/py.mk
+include $(TOP)/py/py.mk
CROSS_COMPILE = arm-none-eabi-
INC += -I.
-INC += -I..
+INC += -I$(TOP)
INC += -I$(BUILD)
-INC += -I../tools/tinytest/
+INC += -I$(TOP)/tools/tinytest/
CFLAGS_CORTEX_M3 = -mthumb -mcpu=cortex-m3 -mfloat-abi=soft
CFLAGS = $(INC) -Wall -Wpointer-arith -Werror -std=gnu99 $(CFLAGS_CORTEX_M3) $(COPT) \
@@ -63,17 +63,13 @@ LIB_SRC_C = $(addprefix lib/,\
libm/asinfacosf.c \
libm/atanf.c \
libm/atan2f.c \
- )
-
-STM_SRC_C = $(addprefix stmhal/,\
- pybstdio.c \
+ utils/sys_stdio_mphal.c \
)
OBJ_COMMON =
OBJ_COMMON += $(PY_O)
OBJ_COMMON += $(addprefix $(BUILD)/, $(SRC_COMMON_C:.c=.o))
OBJ_COMMON += $(addprefix $(BUILD)/, $(LIB_SRC_C:.c=.o))
-OBJ_COMMON += $(addprefix $(BUILD)/, $(STM_SRC_C:.c=.o))
OBJ_RUN =
OBJ_RUN += $(addprefix $(BUILD)/, $(SRC_RUN_C:.c=.o))
@@ -86,7 +82,7 @@ OBJ_TEST += $(BUILD)/tinytest.o
OBJ = $(OBJ_COMMON) $(OBJ_RUN) $(OBJ_TEST)
# List of sources for qstr extraction
-SRC_QSTR += $(SRC_COMMON_C) $(SRC_RUN_C) $(STM_SRC_C)
+SRC_QSTR += $(SRC_COMMON_C) $(SRC_RUN_C) $(LIB_SRC_C)
all: run
@@ -102,10 +98,10 @@ test: $(BUILD)/firmware-test.elf
$(BUILD)/test_main.o: $(BUILD)/genhdr/tests.h
$(BUILD)/genhdr/tests.h:
- $(Q)echo "Generating $@";(cd ../tests; ../tools/tinytest-codegen.py) > $@
+ $(Q)echo "Generating $@";(cd $(TOP)/tests; ../tools/tinytest-codegen.py) > $@
$(BUILD)/tinytest.o:
- $(Q)$(CC) $(CFLAGS) -DNO_FORKING -o $@ -c ../tools/tinytest/tinytest.c
+ $(Q)$(CC) $(CFLAGS) -DNO_FORKING -o $@ -c $(TOP)/tools/tinytest/tinytest.c
## `$(LD)` doesn't seem to like `--specs` for some reason, but we can just use `$(CC)` here.
$(BUILD)/firmware.elf: $(OBJ_COMMON) $(OBJ_RUN)
@@ -116,4 +112,4 @@ $(BUILD)/firmware-test.elf: $(OBJ_COMMON) $(OBJ_TEST)
$(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
$(Q)$(SIZE) $@
-include ../py/mkrules.mk
+include $(TOP)/py/mkrules.mk
diff --git a/qemu-arm/mpconfigport.h b/qemu-arm/mpconfigport.h
index 876751f38..317064b7f 100644
--- a/qemu-arm/mpconfigport.h
+++ b/qemu-arm/mpconfigport.h
@@ -1,6 +1,6 @@
#include <stdint.h>
-// options to control how Micro Python is built
+// options to control how MicroPython is built
#define MICROPY_ALLOC_PATH_MAX (512)
#define MICROPY_EMIT_X64 (0)
@@ -58,7 +58,7 @@ typedef long mp_off_t;
// extra built in names to add to the global namespace
#define MICROPY_PORT_BUILTINS \
- { MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj },
+ { MP_ROM_QSTR(MP_QSTR_open), MP_ROM_PTR(&mp_builtin_open_obj) },
// extra built-in modules to add to the list of known ones
extern const struct _mp_obj_module_t mp_module_uos;