diff pru_rtaudio.p @ 45:579c86316008 newapi

Major API overhaul. Moved to a single data structure for handling render functions. Functionally, generally similar except for scheduling within PRU loop function, which now uses interrupts from the PRU rather than polling. This requires an updated kernel.
author andrewm
date Thu, 28 May 2015 14:35:55 -0400
parents 419ce4ebfc4c
children 472e892c6e41
line wrap: on
line diff
--- a/pru_rtaudio.p	Wed May 13 12:23:37 2015 +0100
+++ b/pru_rtaudio.p	Thu May 28 14:35:55 2015 -0400
@@ -31,7 +31,8 @@
 #define GPIO_CLEARDATAOUT 0x190
 #define GPIO_SETDATAOUT 0x194
 
-#define PRU0_ARM_INTERRUPT 19
+#define PRU0_ARM_INTERRUPT 19	// Interrupt signalling we're done
+#define PRU1_ARM_INTERRUPT 20	// Interrupt signalling a block is ready
 
 #define C_ADC_DAC_MEM C24     // PRU0 mem
 #ifdef DBOX_CAPE
@@ -990,7 +991,8 @@
       // Notify ARM of buffer swap
       AND r2, reg_flags, (1 << FLAG_BIT_BUFFER1)    // Mask out every but low bit
       SBBO r2, reg_comm_addr, COMM_CURRENT_BUFFER, 4
-
+      MOV R31.b0, PRU1_ARM_INTERRUPT + 16           // Interrupt to host loop
+	
       // Increment the frame count in the comm buffer (for status monitoring)
       LBBO r2, reg_comm_addr, COMM_FRAME_COUNT, 4
       ADD r2, r2, reg_frame_total