Skip to content

Commit

Permalink
micropython: update to v1.17
Browse files Browse the repository at this point in the history
This updates the micropython submodule to v1.17 and makes changes to
the code base as required by upstream changes.
  • Loading branch information
dlech committed Sep 1, 2021
1 parent d0c46d2 commit aaebd29
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 43 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
- Fixed Ultrasonic Sensor and Color Sensor turning off when a
user script ends ([support#456]).

### Changed:
- Updated to MicroPython v1.17.

[support#456]: https://github.com/pybricks/support/issues/456

## [3.1.0a4] - 2021-08-30
Expand Down
16 changes: 8 additions & 8 deletions bricks/ev3dev/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ LDFLAGS += $(LDFLAGS_MOD) $(LDFLAGS_ARCH) -lm $(LDFLAGS_EXTRA)
LDFLAGS += -lpthread

ifeq ($(MICROPY_USE_READLINE),1)
INC += -I$(TOP)/lib/mp-readline
INC += -I$(TOP)/shared/readline
CFLAGS_MOD += -DMICROPY_USE_READLINE=1
LIB_SRC_C_EXTRA += mp-readline/readline.c
SHARED_SRC_C_EXTRA += readline/readline.c
endif
ifeq ($(MICROPY_PY_TERMIOS),1)
CFLAGS_MOD += -DMICROPY_PY_TERMIOS=1
Expand Down Expand Up @@ -216,11 +216,11 @@ SRC_C = $(addprefix ports/unix/,\

SRC_C += $(SRC_MOD)

LIB_SRC_C = $(addprefix lib/,\
$(LIB_SRC_C_EXTRA) \
SHARED_SRC_C = $(addprefix shared/,\
runtime/gchelper_generic.c \
runtime/pyexec.c \
timeutils/timeutils.c \
utils/gchelper_generic.c \
utils/pyexec.c \
$(SHARED_SRC_C_EXTRA) \
)

# Pybricks port core source files
Expand Down Expand Up @@ -338,14 +338,14 @@ PYBRICKS_LIB_SRC_C = $(addprefix lib/,\

OBJ = $(PY_O)
OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
OBJ += $(addprefix $(BUILD)/, $(LIB_SRC_C:.c=.o))
OBJ += $(addprefix $(BUILD)/, $(SHARED_SRC_C:.c=.o))
OBJ += $(addprefix $(BUILD)/, $(EXTMOD_SRC_C:.c=.o))
OBJ += $(addprefix $(BUILD)/, $(PYBRICKS_PYBRICKS_SRC_C:.c=.o))
OBJ += $(addprefix $(BUILD)/, $(PYBRICKS_SRC_C:.c=.o))
OBJ += $(addprefix $(BUILD)/, $(PYBRICKS_LIB_SRC_C:.c=.o))

# List of sources for qstr extraction
SRC_QSTR += $(SRC_C) $(LIB_SRC_C) $(EXTMOD_SRC_C) $(PYBRICKS_SRC_C) $(PYBRICKS_PYBRICKS_SRC_C)
SRC_QSTR += $(SRC_C) $(SHARED_SRC_C) $(EXTMOD_SRC_C) $(PYBRICKS_SRC_C) $(PYBRICKS_PYBRICKS_SRC_C)
# Append any auto-generated sources that are needed by sources listed in
# SRC_QSTR
SRC_QSTR_AUTO_DEPS +=
Expand Down
2 changes: 1 addition & 1 deletion bricks/ev3dev/ev3dev_mphal.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void mp_hal_stdio_mode_orig(void);

#if MICROPY_USE_READLINE == 1 && MICROPY_PY_BUILTINS_INPUT
#include "py/misc.h"
#include "lib/mp-readline/readline.h"
#include "shared/readline/readline.h"
// For built-in input() we need to wrap the standard readline() to enable raw mode
#define mp_hal_readline mp_hal_readline
static inline int mp_hal_readline(vstr_t *vstr, const char *p) {
Expand Down
15 changes: 8 additions & 7 deletions bricks/ev3rt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ endif
endif

ifeq ($(MICROPY_USE_READLINE),1)
INC += -I$(MPTOP)/lib/mp-readline
INC += -I$(MPTOP)/shared/readline
CFLAGS_MOD += -DMICROPY_USE_READLINE=1
LIB_SRC_C_EXTRA += mp-readline/readline.c
SHARED_SRC_C_EXTRA += readline/readline.c
endif
ifeq ($(MICROPY_USE_READLINE),2)
CFLAGS_MOD += -DMICROPY_USE_READLINE=2
Expand Down Expand Up @@ -159,11 +159,11 @@ SRC_C = $(addprefix ports/unix/,\
mphal.c \
)

LIB_SRC_C = $(addprefix lib/,\
$(LIB_SRC_C_EXTRA) \
utils/printf.c \
utils/interrupt_char.c \
SHARED_SRC_C = $(addprefix shared/,\
runtime/printf.c \
runtime/interrupt_char.c \
timeutils/timeutils.c \
$(SHARED_SRC_C_EXTRA) \
)

ifeq ($(MICROPY_FATFS),1)
Expand All @@ -175,10 +175,11 @@ endif

OBJ = $(PY_O)
OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
OBJ += $(addprefix $(BUILD)/, $(SHARED_SRC_C:.c=.o))
OBJ += $(addprefix $(BUILD)/, $(LIB_SRC_C:.c=.o))

# List of sources for qstr extraction
SRC_QSTR += $(SRC_C) $(LIB_SRC_C)
SRC_QSTR += $(SRC_C) $(SHARED_SRC_C) $(LIB_SRC_C)
# Append any auto-generated sources that are needed by sources listed in
# SRC_QSTR
SRC_QSTR_AUTO_DEPS +=
Expand Down
2 changes: 1 addition & 1 deletion bricks/ev3rt/mphal.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include "py/repl.h"
#include "py/gc.h"
#include "py/mperrno.h"
#include "lib/utils/pyexec.h"
#include "shared/runtime/pyexec.h"

mp_import_stat_t mp_import_stat(const char *path) {
return MP_IMPORT_STAT_NO_EXIST;
Expand Down
13 changes: 7 additions & 6 deletions bricks/nxt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ QSTR_GLOBAL_DEPENDENCIES =
# MicroPython feature configurations
MICROPY_ROM_TEXT_COMPRESSION ?= 1

MPY_CROSS = ../../micropython/mpy-cross/mpy-cross
MPY_CROSS_FLAGS += -mno-unicode

# include py core make definitions
Expand Down Expand Up @@ -96,16 +97,16 @@ SRC_C = \
# if we don't do it this way. So we need to be very careful about name clashes
# between the top level directory and the micropython/ subdirectory.

SRC_C += $(addprefix lib/,\
SRC_C += $(addprefix shared/,\
libc/string0.c \
mp-readline/readline.c \
utils/interrupt_char.c \
utils/pyexec.c \
utils/stdout_helpers.c \
readline/readline.c \
runtime/interrupt_char.c \
runtime/pyexec.c \
runtime/stdout_helpers.c \
)

SRC_S = \
lib/utils/gchelper_arm7tdmi.s \
shared/runtime/gchelper_arm7tdmi.s \

SRC_C_NXT := $(addprefix nxt-firmware-drivers/nxt/,\
aic.c \
Expand Down
6 changes: 3 additions & 3 deletions bricks/nxt/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#include "py/mperrno.h"
#include "py/persistentcode.h"
#include "py/stackctrl.h"
#include "lib/utils/pyexec.h"
#include "lib/utils/interrupt_char.h"
#include "shared/runtime/pyexec.h"
#include "shared/runtime/interrupt_char.h"

#include "py/mphal.h"

Expand Down Expand Up @@ -202,7 +202,7 @@ int main(int argc, char **argv) {

// defined in linker script
extern uint32_t _estack;
// defined in lib/utils/gchelper_arm7tdmi.s
// defined in shared/runtime/gchelper_arm7tdmi.s
extern uintptr_t gc_helper_get_regs_and_sp(uintptr_t *regs);

void gc_collect(void) {
Expand Down
8 changes: 4 additions & 4 deletions bricks/stm32/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
#include <pybricks/common.h>
#include <pybricks/util_mp/pb_obj_helper.h>

#include "lib/mp-readline/readline.h"
#include "lib/utils/gchelper.h"
#include "lib/utils/interrupt_char.h"
#include "lib/utils/pyexec.h"
#include "shared/readline/readline.h"
#include "shared/runtime/gchelper.h"
#include "shared/runtime/interrupt_char.h"
#include "shared/runtime/pyexec.h"
#include "py/compile.h"
#include "py/gc.h"
#include "py/mperrno.h"
Expand Down
19 changes: 10 additions & 9 deletions bricks/stm32/stm32.mk
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ CFLAGS += -D$(PB_CMSIS_MCU)
CFLAGS += -DSTM32_H='<stm32$(PB_MCU_SERIES_LCASE)xx.h>'
CFLAGS += -DSTM32_HAL_H='<stm32$(PB_MCU_SERIES_LCASE)xx_hal.h>'

MPY_CROSS = ../../micropython/mpy-cross/mpy-cross
# TODO: probably only need no-unicode on movehub
MPY_CROSS_FLAGS += -mno-unicode

Expand All @@ -167,23 +168,23 @@ SRC_C = $(addprefix bricks/stm32/,\
# if we don't do it this way. So we need to be very careful about name clashes
# between the top level directory and the micropython/ subdirectory.

SRC_C += $(addprefix lib/,\
SRC_C += $(addprefix shared/,\
libc/string0.c \
mp-readline/readline.c \
utils/gchelper_native.c \
utils/interrupt_char.c \
utils/pyexec.c \
utils/stdout_helpers.c \
utils/sys_stdio_mphal.c \
readline/readline.c \
runtime/gchelper_native.c \
runtime/interrupt_char.c \
runtime/pyexec.c \
runtime/stdout_helpers.c \
runtime/sys_stdio_mphal.c \
)

SRC_S = \
lib/pbio/platform/$(PBIO_PLATFORM)/startup.s \

ifeq ($(PB_MCU_SERIES),F0)
SRC_S += lib/utils/gchelper_m0.s
SRC_S += shared/runtime/gchelper_m0.s
else
SRC_S += lib/utils/gchelper_m3.s
SRC_S += shared/runtime/gchelper_m3.s
endif

# Pybricks modules
Expand Down
1 change: 0 additions & 1 deletion lib/pbio/drv/bluetooth/pybricks_service_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,3 @@ void pybricks_service_server_request_can_send_now(btstack_context_callback_regis
int pybricks_service_server_send(hci_con_handle_t con_handle, const uint8_t *data, uint16_t size);

#endif // PYBRICKS_SERVICE_SERVER_H

1 change: 0 additions & 1 deletion lib/pbio/platform/move_hub/bluenrg_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@
#define HCI_MAX_PAYLOAD_SIZE 127

#endif /* _BLUENRG_CONF_H_ */

2 changes: 1 addition & 1 deletion micropython
Submodule micropython updated 642 files
2 changes: 1 addition & 1 deletion npm/mpy-cross/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ SRC = $(addprefix $(MICROPYTHON_DIR)/, \
py/frozenmod.c \
mpy-cross/main.c \
mpy-cross/gccollect.c \
lib/utils/gchelper_generic.c \
shared/runtime/gchelper_generic.c \
)

MPY_CROSS_BUILD := $(MICROPYTHON_DIR)/mpy-cross/build
Expand Down

0 comments on commit aaebd29

Please sign in to comment.