Commit 3e1d1211 authored by Alessio Igor Bogani's avatar Alessio Igor Bogani
Browse files

Changes

parent 65e0f22f
......@@ -8,7 +8,7 @@
/****************************************************************************/
-cr /* Link using C conventions */
-stack 0x1400
-stack 0x1000
-heap 0x000
/* Specify the System Memory Map */
......
......@@ -120,7 +120,9 @@ volatile float OCnorm, OCnorm_previous;
struct pru2user_data_transfer {
float OCnorm;
unsigned int OVnorm;
#if defined ADVANCEDTIMESTAMPING
unsigned int num5ns;
#endif
};
struct pru2user_data_transfer p2udt[SAMPLES];
......@@ -200,9 +202,11 @@ int main(void)
}
}
#if defined ADVANCEDTIMESTAMPING
/* Enable cycle counter */
PRU1_CTRL.CTRL_bit.CTR_EN = 1;
PRU1_CTRL.CYCLE = 1;
#endif
//fill the buffer
for(i = 0; i < 32; i++)
......@@ -282,13 +286,17 @@ int main(void)
OCnorm_previous = OCnorm;
ADC2_previous = ADC2;
#if defined ADVANCEDTIMESTAMPING
if (HEAD_index == 0) {
PRU1_CTRL.CYCLE = 1; // Reset PRU cycles counter
}
#endif
p2udt[HEAD_index].OCnorm = OCnorm;
p2udt[HEAD_index].OVnorm = ADC2;
#if defined ADVANCEDTIMESTAMPING
p2udt[HEAD_index].num5ns = PRU1_CTRL.CYCLE;
#endif
HEAD_index++;
if (HEAD_index >= SAMPLES) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment