From 31deee90608e76c0e0829db8e819f03ae85b1bfb Mon Sep 17 00:00:00 2001 From: Alessandro Gatti Date: Fri, 14 Nov 2025 04:19:11 +0100 Subject: [PATCH] rp2/machine_pin: Reduce footprint of pin structures. This commit performs a few minor changes to the structures used to store board pin information, in order to reduce the impact on the .rodata section of the firmware of instances of those structures. The data type used to store the QSTR name of both regular and alternate function pins ("machine_pin_obj_t" and "machine_pin_af_obj_t") is changed from "qstr" to "qstr_short_t", that is able to store the same name string index but in half the size. Signed-off-by: Alessandro Gatti --- ports/rp2/machine_pin.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/rp2/machine_pin.h b/ports/rp2/machine_pin.h index 2d85bdcadc..47c0d328e5 100644 --- a/ports/rp2/machine_pin.h +++ b/ports/rp2/machine_pin.h @@ -40,7 +40,7 @@ enum { typedef struct _machine_pin_af_obj_t { mp_obj_base_t base; - qstr name; + qstr_short_t name; uint8_t idx : 4; uint8_t fn : 4; uint8_t unit : 8; @@ -48,7 +48,7 @@ typedef struct _machine_pin_af_obj_t { typedef struct _machine_pin_obj_t { mp_obj_base_t base; - qstr name; + qstr_short_t name; uint8_t id : 6; #if MICROPY_HW_PIN_EXT_COUNT uint8_t is_ext : 1;