forked from M-Labs/artiq
examples/coredev_test: use CoreCom as a context manager
This commit is contained in:
parent
b152ecca1f
commit
2f334589f0
|
@ -9,9 +9,10 @@ class CompilerTest(Experiment):
|
|||
self.led.set(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
coredev = core.Core(runtime.Environment(), corecom_serial.CoreCom())
|
||||
exp = CompilerTest(
|
||||
core=coredev,
|
||||
led=gpio_core.GPIOOut(coredev, 0)
|
||||
)
|
||||
exp.run()
|
||||
with corecom_serial.CoreCom() as com:
|
||||
coredev = core.Core(runtime.Environment(), com)
|
||||
exp = CompilerTest(
|
||||
core=coredev,
|
||||
led=gpio_core.GPIOOut(coredev, 0)
|
||||
)
|
||||
exp.run()
|
||||
|
|
Loading…
Reference in New Issue