Browse Source

mimxrt: Enable ROM text compression.

To reduce size of firmware, by about 3k.
pull/10924/head
iabdalkader 2 years ago
committed by Damien George
parent
commit
4d3897f80e
  1. 5
      ports/mimxrt/Makefile
  2. 2
      ports/mimxrt/machine_led.c
  3. 2
      ports/mimxrt/machine_sdcard.c

5
ports/mimxrt/Makefile

@ -40,6 +40,9 @@ include ../../py/mkenv.mk
# Include micropython configuration board makefile
include $(BOARD_DIR)/mpconfigboard.mk
# MicroPython feature configurations
MICROPY_ROM_TEXT_COMPRESSION ?= 1
# File containing description of content to be frozen into firmware.
FROZEN_MANIFEST ?= boards/manifest.py
@ -290,6 +293,8 @@ SRC_QSTR += $(SRC_C) $(SHARED_SRC_C) $(GEN_PINS_SRC)
CFLAGS += -g # always include debug info in the ELF
ifeq ($(DEBUG),1)
CFLAGS += -Og
# Disable text compression in debug builds
MICROPY_ROM_TEXT_COMPRESSION = 0
else
CFLAGS += -Os -DNDEBUG
endif

2
ports/mimxrt/machine_led.c

@ -44,7 +44,7 @@ STATIC mp_obj_t led_obj_make_new(const mp_obj_type_t *type, size_t n_args, size_
// Check led id is in range
if (!(1 <= led_id && led_id <= NUM_LEDS)) {
mp_raise_msg_varg(&mp_type_ValueError, "LED(%d) doesn't exist", led_id);
mp_raise_msg_varg(&mp_type_ValueError, MP_ERROR_TEXT("LED(%d) doesn't exist"), led_id);
}
// Return reference to static object

2
ports/mimxrt/machine_sdcard.c

@ -67,7 +67,7 @@ STATIC mp_obj_t sdcard_obj_make_new(const mp_obj_type_t *type, size_t n_args, si
mp_int_t sdcard_id = args[SDCARD_INIT_ARG_ID].u_int;
if (!(1 <= sdcard_id && sdcard_id <= MP_ARRAY_SIZE(mimxrt_sdcard_objs))) {
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "SDCard(%d) doesn't exist", sdcard_id));
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, MP_ERROR_TEXT("SDCard(%d) doesn't exist"), sdcard_id));
}
mimxrt_sdcard_obj_t *self = &mimxrt_sdcard_objs[(sdcard_id - 1)];

Loading…
Cancel
Save