2014-05-04 11:40:51 +00:00
|
|
|
import pyb
|
|
|
|
|
2016-09-09 09:33:50 +00:00
|
|
|
# test basic functionality
|
2020-03-23 02:26:08 +00:00
|
|
|
ext = pyb.ExtInt("X5", pyb.ExtInt.IRQ_RISING, pyb.Pin.PULL_DOWN, lambda l: print("line:", l))
|
2014-05-03 15:43:27 +00:00
|
|
|
ext.disable()
|
|
|
|
ext.enable()
|
|
|
|
print(ext.line())
|
|
|
|
ext.swint()
|
2016-09-09 09:33:50 +00:00
|
|
|
|
|
|
|
# test swint while disabled, then again after re-enabled
|
|
|
|
ext.disable()
|
|
|
|
ext.swint()
|
|
|
|
ext.enable()
|
|
|
|
ext.swint()
|
|
|
|
|
|
|
|
# disable now that the test is finished
|
2014-05-03 15:43:27 +00:00
|
|
|
ext.disable()
|