stm32/pin: Exclude Pin.cpu/Pin.board if they contain no entries.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2024-12-11 00:05:19 +11:00
parent 3203e950fc
commit a2efafcce3

View File

@@ -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) },