diff options
| author | Scott Shawcroft <scott@adafruit.com> | 2020-09-25 11:21:16 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-25 11:21:16 -0700 |
| commit | 2b856dbd289e1df59836da198f34319976f053af (patch) | |
| tree | 169024a1795ef35739bdefaf6d52f3633d6cb881 /shared-bindings/microcontroller/Pin.c | |
| parent | c07307a3096f3218565b2375244536ec928f9c7a (diff) | |
| parent | 33952023e89b96530bc2acaaf6a5f03da01d9a3c (diff) | |
Merge pull request #3470 from askpatrickw/fix-pin-printout
Print package if it exists for pin or module only if it does not
Diffstat (limited to 'shared-bindings/microcontroller/Pin.c')
| -rw-r--r-- | shared-bindings/microcontroller/Pin.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/shared-bindings/microcontroller/Pin.c b/shared-bindings/microcontroller/Pin.c index 1294b78f0..6ba02a0e7 100644 --- a/shared-bindings/microcontroller/Pin.c +++ b/shared-bindings/microcontroller/Pin.c @@ -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 = { |
