I am trying to run an RPC that sends a serial command to a USB device at a specific timestamp. However, it seems that the RPC actually runs roughly immediately when the code is run, instead of after kernel delays, etc.
@kernel
def run(self):
self.core.reset()
self.ttl.pulse(1.e-6)
delay(1.)
self.serial() # my rpc
I see the effect of the serial communication roughly 1ms after the ttl pulse, instead of the 1 second delay I want. Is there a straightforward way to get the rpc to execute wrt the position of the timeline cursor, instead of whenever the core device reaches the rpc while scheduling things into the FIFO?