mirror of
https://github.com/micropython/micropython.git
synced 2026-01-07 04:30:24 +01:00
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:
committed by
Damien George
parent
fb8ecaecf5
commit
31deee9060
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user