2014-05-04 12:40:51 +01:00
|
|
|
import pyb
|
|
|
|
|
2016-09-09 10:33:50 +01:00
|
|
|
# test basic functionality
|
2017-02-06 02:48:01 +00:00
|
|
|
ext = pyb.ExtInt('Y1', pyb.ExtInt.IRQ_RISING, pyb.Pin.PULL_DOWN, lambda l:print('line:', l))
|
2014-05-03 16:43:27 +01:00
|
|
|
ext.disable()
|
|
|
|
ext.enable()
|
|
|
|
print(ext.line())
|
|
|
|
ext.swint()
|
2016-09-09 10:33:50 +01: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 16:43:27 +01:00
|
|
|
ext.disable()
|