forked from M-Labs/artiq
1
0
Fork 0

examples/coredev_test: use CoreCom as a context manager

This commit is contained in:
Sebastien Bourdeauducq 2014-07-05 22:53:48 +02:00
parent b152ecca1f
commit 2f334589f0
1 changed files with 7 additions and 6 deletions

View File

@ -9,9 +9,10 @@ class CompilerTest(Experiment):
self.led.set(1) self.led.set(1)
if __name__ == "__main__": if __name__ == "__main__":
coredev = core.Core(runtime.Environment(), corecom_serial.CoreCom()) with corecom_serial.CoreCom() as com:
exp = CompilerTest( coredev = core.Core(runtime.Environment(), com)
core=coredev, exp = CompilerTest(
led=gpio_core.GPIOOut(coredev, 0) core=coredev,
) led=gpio_core.GPIOOut(coredev, 0)
exp.run() )
exp.run()