Print package if it exists for pin or module only if it does not

This commit is contained in:
askpatricw 2020-09-25 10:08:26 -07:00
parent dd86cb00ad
commit 33952023e8
1 changed files with 5 additions and 1 deletions

View File

@ -71,7 +71,11 @@ STATIC void mcu_pin_print(const mp_print_t *print, mp_obj_t self_in, mp_print_ki
qstr name;
get_pin_name(self, &package, &module, &name);
mp_printf(print, "%q.%q.%q", MP_QSTR_microcontroller, MP_QSTR_pin, name);
if (package){
mp_printf(print, "%q.%q.%q", package, module, name);
} else {
mp_printf(print, "%q.%q", module , name);
}
}
const mp_obj_type_t mcu_pin_type = {