Update Python subset for kernels authored by Leon Riesebos's avatar Leon Riesebos
......@@ -76,6 +76,7 @@ Please take into account the following important notes:
finally:
# Now we have slack to perform this operation
self.led.pulse(50 * us)
self.core.wait_until_mu(now_mu)
# After the finally clause, the exception will be raised again
@kernel
......@@ -92,6 +93,10 @@ Please take into account the following important notes:
finally:
# Guarantee that the LED will be turned off
self.led.off()
# Note that the off() call is not protected from underflows
# Note that without wait_until_mu() we can not guarantee this event is not cancelled
self.core.wait_until_mu(now_mu)
@kernel
def example_c(self):
......@@ -106,6 +111,7 @@ Please take into account the following important notes:
self.core.break_realtime()
# Guarantee that the LED will be turned off, even if turning it off caused the initial exception
self.led.off()
self.core.wait_until_mu(now_mu)
raise # Make sure the exception is still raised
```
......
......