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