diff core/PRU.cpp @ 253:33e0e4831763 prerelease

Started prerelease branch; updated PRU code to be able to run on either PRU.
author andrewm
date Mon, 16 May 2016 12:13:58 +0100
parents c0bf6157f67e
children abd3657016ea
line wrap: on
line diff
--- a/core/PRU.cpp	Wed May 11 10:29:23 2016 +0100
+++ b/core/PRU.cpp	Mon May 16 12:13:58 2016 +0100
@@ -38,7 +38,7 @@
 using namespace std;
 
 #define PRU_MEM_MCASP_OFFSET 0x2000  // Offset within PRU-SHARED RAM
-#define PRU_MEM_MCASP_LENGTH 0x2000  // Length of McASP memory, in bytes
+#define PRU_MEM_MCASP_LENGTH 0x1000  // Length of McASP memory, in bytes
 #define PRU_MEM_DAC_OFFSET 0x0     // Offset within PRU0 RAM
 #define PRU_MEM_DAC_LENGTH 0x2000  // Length of ADC+DAC memory, in bytes
 #define PRU_MEM_COMM_OFFSET 0x0    // Offset within PRU-SHARED RAM
@@ -51,12 +51,13 @@
 #define PRU_SHOULD_SYNC     3
 #define PRU_SYNC_ADDRESS    4
 #define PRU_SYNC_PIN_MASK   5
-#define PRU_LED_ADDRESS		6
-#define PRU_LED_PIN_MASK	7
-#define PRU_FRAME_COUNT		8
-#define PRU_USE_SPI			9
+#define PRU_LED_ADDRESS	     6
+#define PRU_LED_PIN_MASK     7
+#define PRU_FRAME_COUNT      8
+#define PRU_USE_SPI          9
 #define PRU_SPI_NUM_CHANNELS 10
-#define PRU_USE_DIGITAL    11
+#define PRU_USE_DIGITAL      11
+#define PRU_PRU_NUMBER       12
 
 short int digitalPins[NUM_DIGITALS]={
 		GPIO_NO_BIT_0,
@@ -332,6 +333,7 @@
     pru_buffer_comm[PRU_SHOULD_SYNC] = 0;
     pru_buffer_comm[PRU_SYNC_ADDRESS] = 0;
     pru_buffer_comm[PRU_SYNC_PIN_MASK] = 0;
+    pru_buffer_comm[PRU_PRU_NUMBER] = pru_number;
     if(led_enabled) {
     	pru_buffer_comm[PRU_LED_ADDRESS] = USERLED3_GPIO_BASE;
     	pru_buffer_comm[PRU_LED_PIN_MASK] = USERLED3_PIN_MASK;