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