Merge pull request #3470 from askpatrickw/fix-pin-printout

Print package if it exists for pin or module only if it does not
This commit is contained in:
Scott Shawcroft 2020-09-25 11:21:16 -07:00 committed by GitHub
commit 2b856dbd28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 = {