diff dac.pio @ 25:6070d2e66b4c

Cascade IRQs from DAC to control so manual & external trigger are the same.
author Daniel O'Connor <darius@dons.net.au>
date Tue, 25 Feb 2025 16:53:32 +1030
parents 9ad0dd5c638c
children e1d8fe3e418a
line wrap: on
line diff
--- a/dac.pio	Tue Feb 25 16:47:00 2025 +1030
+++ b/dac.pio	Tue Feb 25 16:53:32 2025 +1030
@@ -3,7 +3,9 @@
 ;
 
 .program dac
-.define TRIGGER_IRQ 0
+.define DAC_IRQ 0
+.define DAC_TRIGGER_IRQ 0
+.define CTRL_TRIGGER_IRQ 1
 ; Need 1 side set pin, the clock
 .side_set 1
 
@@ -11,7 +13,9 @@
     mov pins, null side 0
     nop side 1
 ; Wait for start trigger and clear IRQ
-    wait 1 irq TRIGGER_IRQ side 0
+    wait 1 irq DAC_TRIGGER_IRQ side 0
+; Trigger the control SM
+    irq nowait CTRL_TRIGGER_IRQ side 0
 ; Clock DAC and write data from the FIFO
 ; DAC clocks data in on the rising clock edge
 .wrap_target