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 <a.gatti@frob.it>
This commit is contained in:
Alessandro Gatti
2025-11-14 04:19:11 +01:00
committed by Damien George
parent fb8ecaecf5
commit 31deee9060

View File

@@ -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;