diff options
author | Dave Hylands <davehylands@fullstory.com> | 2020-08-11 12:44:51 -0700 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2020-08-21 13:42:47 +1000 |
commit | 8727c4e2eca9026494c173061c5905d54fa5f73d (patch) | |
tree | a1f082c3220240245567f102d05bb09ebfb2462b /py/runtime.c | |
parent | e76c7466b62c940150cf1b5000e18f60a5efa2e3 (diff) |
stm32/pin_defs_stm32: Fix pin printing to show IN mode correctly.
Prior to this commit, if you configure a pin as an output type (I2C in this
example) and then later configure it back as an input, then it will report
the type incorrectly. Example:
>>> import machine
>>> b6 = machine.Pin('B6')
>>> b6
Pin(Pin.cpu.B6, mode=Pin.IN)
>>> machine.I2C(1)
I2C(1, scl=B6, sda=B7, freq=420000)
>>> b6
Pin(Pin.cpu.B6, mode=Pin.ALT_OPEN_DRAIN, pull=Pin.PULL_UP, af=Pin.AF4_I2C1)
>>> b6.init(machine.Pin.IN)
>>> b6
Pin(Pin.cpu.B6, mode=Pin.ALT_OPEN_DRAIN, af=Pin.AF4_I2C1)
With this commit the last print now works:
>>> b6
Pin(Pin.cpu.B6, mode=Pin.IN)
Diffstat (limited to 'py/runtime.c')
0 files changed, 0 insertions, 0 deletions