Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch translate() to the header file #6440

Merged
merged 15 commits into from
Jun 6, 2022
1 change: 1 addition & 0 deletions devices/ble_hci/common-hal/_bleio/att.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include "shared-bindings/_bleio/Service.h"
#include "shared-bindings/_bleio/UUID.h"
#include "supervisor/shared/tick.h"
#include "supervisor/shared/translate/translate.h"

STATIC uint16_t max_mtu = BT_ATT_DEFAULT_LE_MTU; // 23
STATIC unsigned long timeout = 5000;
Expand Down
2 changes: 2 additions & 0 deletions extmod/moduasyncio.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include "shared-bindings/supervisor/__init__.h"
#endif

#include "supervisor/shared/translate/translate.h"

#if MICROPY_PY_UASYNCIO

// Used when task cannot be guaranteed to be non-NULL.
Expand Down
2 changes: 2 additions & 0 deletions extmod/modubinascii.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include "py/runtime.h"
#include "py/binary.h"

#include "supervisor/shared/translate/translate.h"

static void check_not_unicode(const mp_obj_t arg) {
#if MICROPY_CPYTHON_COMPAT
if (mp_obj_is_str(arg)) {
Expand Down
2 changes: 1 addition & 1 deletion extmod/moductypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "py/objtuple.h"
#include "py/binary.h"

#include "supervisor/shared/translate.h"
#include "supervisor/shared/translate/translate.h"

#if MICROPY_PY_UCTYPES

Expand Down
2 changes: 1 addition & 1 deletion extmod/moduhashlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include "py/runtime.h"

#include "supervisor/shared/translate.h"
#include "supervisor/shared/translate/translate.h"

#if MICROPY_PY_UHASHLIB

Expand Down
2 changes: 1 addition & 1 deletion extmod/moduheapq.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "py/objlist.h"
#include "py/runtime.h"

#include "supervisor/shared/translate.h"
#include "supervisor/shared/translate/translate.h"

#if MICROPY_PY_UHEAPQ

Expand Down
2 changes: 1 addition & 1 deletion extmod/modujson.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "py/runtime.h"
#include "py/stream.h"

#include "supervisor/shared/translate.h"
#include "supervisor/shared/translate/translate.h"

#if MICROPY_PY_UJSON

Expand Down
2 changes: 1 addition & 1 deletion extmod/modutimeq.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "py/runtime.h"
#include "py/smallint.h"

#include "supervisor/shared/translate.h"
#include "supervisor/shared/translate/translate.h"

#if MICROPY_PY_UTIMEQ

Expand Down
2 changes: 1 addition & 1 deletion extmod/moduzlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "py/stream.h"
#include "py/mperrno.h"

#include "supervisor/shared/translate.h"
#include "supervisor/shared/translate/translate.h"

#if MICROPY_PY_UZLIB

Expand Down
2 changes: 1 addition & 1 deletion extmod/vfs_fat.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "extmod/vfs_fat.h"
#include "shared/timeutils/timeutils.h"
#include "supervisor/filesystem.h"
#include "supervisor/shared/translate.h"
#include "supervisor/shared/translate/translate.h"

#if FF_MAX_SS == FF_MIN_SS
#define SECSIZE(fs) (FF_MIN_SS)
Expand Down
2 changes: 1 addition & 1 deletion extmod/vfs_posix_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "py/runtime.h"
#include "py/stream.h"
#include "extmod/vfs_posix.h"
#include "supervisor/shared/translate.h"
#include "supervisor/shared/translate/translate.h"

#if (defined(MICROPY_VFS_POSIX) && MICROPY_VFS_POSIX) || (defined(MICROPY_VFS_POSIX_FILE) && MICROPY_VFS_POSIX_FILE)

Expand Down
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
#include "supervisor/shared/status_leds.h"
#include "supervisor/shared/tick.h"
#include "supervisor/shared/traceback.h"
#include "supervisor/shared/translate.h"
#include "supervisor/shared/translate/translate.h"
#include "supervisor/shared/workflow.h"
#include "supervisor/usb.h"
#include "supervisor/workflow.h"
Expand Down
2 changes: 1 addition & 1 deletion mpy-cross/mpy-cross.mk
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ SRC_C += \
shared/runtime/gchelper_generic.c \
supervisor/stub/safe_mode.c \
supervisor/stub/stack.c \
supervisor/shared/translate.c
supervisor/shared/translate/translate.c

# Add fmode when compiling with mingw gcc
COMPILER_TARGET := $(shell $(CC) -dumpmachine)
Expand Down
12 changes: 4 additions & 8 deletions ports/atmel-samd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ $(echo PERIPHERALS_CHIP_FAMILY=$(PERIPHERALS_CHIP_FAMILY))
#Debugging/Optimization
ifeq ($(DEBUG), 1)
CFLAGS += -ggdb3 -Og -Os
# You may want to disable -flto if it interferes with debugging.
CFLAGS += -flto -flto-partition=one
# You may want to enable these flags to make setting breakpoints easier.
# CFLAGS += -fno-inline -fno-ipa-sra
ifeq ($(CHIP_FAMILY), samd21)
Expand All @@ -147,11 +145,8 @@ else
CFLAGS += -finline-limit=$(CFLAGS_INLINE_LIMIT)
endif

CFLAGS += -flto

ifeq ($(CIRCUITPY_FULL_BUILD),0)
CFLAGS += --param inline-unit-growth=15 --param max-inline-insns-auto=20
CFLAGS += -flto-partition=one
endif

ifdef CFLAGS_BOARD
Expand All @@ -168,8 +163,7 @@ CFLAGS += \
-mcpu=cortex-m0plus \
-msoft-float \
-mfloat-abi=soft \
-DSAMD21 \
-flto-partition=one
-DSAMD21
endif
ifeq ($(CHIP_FAMILY), samd51)
CFLAGS += \
Expand Down Expand Up @@ -206,7 +200,6 @@ endif
CFLAGS += -Wno-stringop-overread -Wno-stringop-overflow

LDFLAGS = $(CFLAGS) -nostartfiles -Wl,-nostdlib -Wl,-T,$(GENERATED_LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs
LDFLAGS += -flto=$(shell $(NPROC))
LIBS := -lgcc -lc

# Use toolchain libm if we're not using our own.
Expand Down Expand Up @@ -277,6 +270,9 @@ SRC_ASF += \
hpl/oscctrl/hpl_oscctrl.c \
hpl/trng/hpl_trng.c \

# Ignore these errors
$(BUILD)/asf4/same54/hpl/sercom/hpl_sercom.o: CFLAGS += -Wno-maybe-uninitialized

else ifeq ($(CHIP_FAMILY), same51)
SRC_ASF += \
hal/src/hal_rand_sync.c \
Expand Down
2 changes: 2 additions & 0 deletions ports/atmel-samd/boards/feather_m4_can/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ LONGINT_IMPL = MPZ

CIRCUITPY__EVE = 1
CIRCUITPY_CANIO = 1

CIRCUITPY_LTO = one
2 changes: 1 addition & 1 deletion ports/atmel-samd/common-hal/_pew/PewPew.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "shared-bindings/digitalio/DigitalInOut.h"
#include "shared-bindings/util.h"
#include "samd/timers.h"
#include "supervisor/shared/translate.h"
#include "supervisor/shared/translate/translate.h"
#include "timer_handler.h"


Expand Down
2 changes: 1 addition & 1 deletion ports/atmel-samd/common-hal/analogio/AnalogIn.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "samd/adc.h"
#include "shared-bindings/analogio/AnalogIn.h"
#include "shared-bindings/microcontroller/Pin.h"
#include "supervisor/shared/translate.h"
#include "supervisor/shared/translate/translate.h"

#include "atmel_start_pins.h"
#include "hal/include/hal_adc_sync.h"
Expand Down
2 changes: 1 addition & 1 deletion ports/atmel-samd/common-hal/analogio/AnalogOut.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "shared-bindings/analogio/AnalogOut.h"
#include "shared-bindings/audioio/AudioOut.h"
#include "shared-bindings/microcontroller/Pin.h"
#include "supervisor/shared/translate.h"
#include "supervisor/shared/translate/translate.h"

#include "atmel_start_pins.h"
#include "hal/include/hal_dac_sync.h"
Expand Down
2 changes: 1 addition & 1 deletion ports/atmel-samd/common-hal/audiobusio/I2SOut.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include "shared-bindings/audiobusio/I2SOut.h"
#include "shared-bindings/audiocore/RawSample.h"
#include "shared-bindings/microcontroller/Pin.h"
#include "supervisor/shared/translate.h"
#include "supervisor/shared/translate/translate.h"

#include "atmel_start_pins.h"
#include "hal/include/hal_gpio.h"
Expand Down
Loading