Skip to content

Commit 3395202

Browse files
committed
Print package if it exists for pin or module only if it does not
1 parent dd86cb0 commit 3395202

File tree

1 file changed

+5
-1
lines changed
  • shared-bindings/microcontroller

1 file changed

+5
-1
lines changed

shared-bindings/microcontroller/Pin.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ STATIC void mcu_pin_print(const mp_print_t *print, mp_obj_t self_in, mp_print_ki
7171
qstr name;
7272

7373
get_pin_name(self, &package, &module, &name);
74-
mp_printf(print, "%q.%q.%q", MP_QSTR_microcontroller, MP_QSTR_pin, name);
74+
if (package){
75+
mp_printf(print, "%q.%q.%q", package, module, name);
76+
} else {
77+
mp_printf(print, "%q.%q", module , name);
78+
}
7579
}
7680

7781
const mp_obj_type_t mcu_pin_type = {

0 commit comments

Comments
 (0)