Commit d4d7d357 authored by Alessio Igor Bogani's avatar Alessio Igor Bogani
Browse files

Changes

parent 2ab64edb
......@@ -8,7 +8,7 @@
/****************************************************************************/
-cr /* Link using C conventions */
-stack 0x1000
-stack 0x800
-heap 0x000
/* Specify the System Memory Map */
......
......@@ -120,10 +120,11 @@ volatile register uint32_t __R31;
#pragma LOCATION(OvA0,0x0060);
#pragma LOCATION(OvA1,0x0064);
#pragma LOCATION(ESD,0x0068); /* Enable Streaming Data from PRU via remoteproc */
#pragma LOCATION(SSF,0x0068); /* Sub-sampling frequency */
volatile int Run; // while 0xFFFF run compensator
volatile float OutputCurrent;
volatile unsigned int SSF;
struct pru2pru_data_transfer {
float OCnorm;
} p2pdt;
......@@ -157,7 +158,6 @@ volatile float ScaleA4;
volatile float ScaleA5;
volatile float OvA0;
volatile float OvA1;
volatile int ESD;
unsigned int trigger, timer, delay, flagDC;
float Integrator, Derivator, prev_error;
......@@ -232,8 +232,8 @@ int main(void)
p2udt.ScaleA5 = FLT_MAX;
p2udt.OvA0 = FLT_MAX;
p2udt.OvA1 = FLT_MAX;
ESD = 0;
SSF = 0;
//init IO readback
IOStatus = 0x0;
......@@ -297,7 +297,7 @@ int main(void)
ReadIO();
if (ESD && changed()) {
if (changed()) {
pru_rpmsg_send(&transport, dst, src, &p2udt, sizeof(struct pru2user_data_transfer));
}
#ifdef benchmark
......@@ -339,7 +339,7 @@ int main(void)
ReadIO();
}
if (ESD && changed()) {
if (SSF && changed()) {
pru_rpmsg_send(&transport, dst, src, &p2udt, sizeof(struct pru2user_data_transfer));
}
}
......
......@@ -91,7 +91,7 @@ volatile register uint32_t __R31;
#pragma LOCATION(Debug2,0x0040)
#pragma LOCATION(Debug3,0x0044)
#pragma LOCATION(ESD,0x0068); /* Enable Streaming Data from PRU via remoteproc */
#pragma LOCATION(SSF,0x0068); /* Sub-sampling frequency */
//#pragma LOCATION(ff,0x2040)
......@@ -99,7 +99,7 @@ volatile unsigned int ADC0, ADC1, ADC2, ADC3, ADC4, ADC5, ADC6;
// ADC0=Aux V, ADC1=Heater temp, ADC2=Out V, ADC3=dc link, ADC4=3.3V, ADC5=heatsink temp, ADC6=5V
volatile unsigned int PRU1FirmRev;
volatile float Debug0,Debug1,Debug2,Debug3;
volatile int ESD;
volatile unsigned int SSF;
struct pru2pru_data_transfer {
float OCnorm;
} p2pdt;
......@@ -148,7 +148,7 @@ int main(void)
ADC0=0;ADC1=0;ADC2=0;ADC3=0;ADC4=0;ADC5=0;ADC6=0;
PRU1FirmRev = 20210415;
Debug0, Debug1, Debug2, Debug3 = 0;
ESD = 0;
SSF = 0;
p2udt.OCnorm[1] = FLT_MAX;
p2udt.OCnorm[2] = -FLT_MAX;
......@@ -265,7 +265,7 @@ int main(void)
p2udt.OVnorm[2] = p2udt.OVnorm[0];
} else { /* Do nothing */ }
if (ESD && ++CC >= 100) {
if (SSF && ++CC >= (100000/SSF)) {
pru_rpmsg_send(&transport, dst, src, &p2udt,
sizeof(struct pru2user_data_transfer));
......
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