fix DMA example

This commit is contained in:
Sebastien Bourdeauducq 2020-07-30 22:25:14 +08:00
parent 2e7090a359
commit bd6222dbaf
1 changed files with 7 additions and 7 deletions

View File

@ -8,11 +8,12 @@ class DMAPulses(EnvExperiment):
@kernel @kernel
def record(self): def record(self):
with self.core_dma.record("pulses"): with self.core_dma.record("pulse"):
# all RTIO operations now go to the "pulses" delay(200*ms)
# all RTIO operations now go to the "pulse"
# DMA buffer, instead of being executed immediately. # DMA buffer, instead of being executed immediately.
self.led0.pulse(100*ns) self.led0.pulse(500*ms)
delay(100*ns)
@kernel @kernel
def run(self): def run(self):
@ -20,7 +21,6 @@ class DMAPulses(EnvExperiment):
self.record() self.record()
# prefetch the address of the DMA buffer # prefetch the address of the DMA buffer
# for faster playback trigger # for faster playback trigger
pulses_handle = self.core_dma.get_handle("pulses") pulse_handle = self.core_dma.get_handle("pulse")
self.core.break_realtime() self.core.break_realtime()
self.core_dma.playback_handle(pulses_handle) self.core_dma.playback_handle(pulse_handle)