From a2efafcce3a03e2fd972e2521cae2c2bec2e88ff Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 11 Dec 2024 00:05:19 +1100 Subject: [PATCH] stm32/pin: Exclude Pin.cpu/Pin.board if they contain no entries. Signed-off-by: Damien George --- ports/stm32/pin.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/stm32/pin.c b/ports/stm32/pin.c index 1430c7c64..7de87f2c7 100644 --- a/ports/stm32/pin.c +++ b/ports/stm32/pin.c @@ -577,8 +577,12 @@ static const mp_rom_map_elem_t pin_locals_dict_table[] = { #endif // class attributes + #if MICROPY_PY_MACHINE_PIN_BOARD_NUM_ENTRIES > 0 { MP_ROM_QSTR(MP_QSTR_board), MP_ROM_PTR(&pin_board_pins_obj_type) }, + #endif + #if MICROPY_PY_MACHINE_PIN_CPU_NUM_ENTRIES > 0 { MP_ROM_QSTR(MP_QSTR_cpu), MP_ROM_PTR(&pin_cpu_pins_obj_type) }, + #endif // class constants { MP_ROM_QSTR(MP_QSTR_IN), MP_ROM_INT(GPIO_MODE_INPUT) },