Skip to content

Commit a2efafc

Browse files
committed
stm32/pin: Exclude Pin.cpu/Pin.board if they contain no entries.
Signed-off-by: Damien George <[email protected]>
1 parent 3203e95 commit a2efafc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ports/stm32/pin.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,8 +577,12 @@ static const mp_rom_map_elem_t pin_locals_dict_table[] = {
577577
#endif
578578

579579
// class attributes
580+
#if MICROPY_PY_MACHINE_PIN_BOARD_NUM_ENTRIES > 0
580581
{ MP_ROM_QSTR(MP_QSTR_board), MP_ROM_PTR(&pin_board_pins_obj_type) },
582+
#endif
583+
#if MICROPY_PY_MACHINE_PIN_CPU_NUM_ENTRIES > 0
581584
{ MP_ROM_QSTR(MP_QSTR_cpu), MP_ROM_PTR(&pin_cpu_pins_obj_type) },
585+
#endif
582586

583587
// class constants
584588
{ MP_ROM_QSTR(MP_QSTR_IN), MP_ROM_INT(GPIO_MODE_INPUT) },

0 commit comments

Comments
 (0)