Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion shared-bindings/microcontroller/Pin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down