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

Add output voltage coefficients

parent b5b53ff1
......@@ -117,6 +117,9 @@ volatile register uint32_t __R31;
#pragma LOCATION(ScaleA4,0x0058)
#pragma LOCATION(ScaleA5,0x005c)
#pragma LOCATION(OvA0,0x0060);
#pragma LOCATION(OvA1,0x0064);
volatile int Run; // while 0xFFFF run compensator
volatile float OutputCurrent;
struct pru2pru_data_transfer {
......@@ -132,6 +135,8 @@ struct pru2user_data_transfer {
float ScaleA3;
float ScaleA4;
float ScaleA5;
float OvA0;
float OvA1;
};
struct pru2user_data_transfer p2udt;
......@@ -148,6 +153,8 @@ volatile float ScaleA2;
volatile float ScaleA3;
volatile float ScaleA4;
volatile float ScaleA5;
volatile float OvA0;
volatile float OvA1;
unsigned int trigger, timer, delay, flagDC;
float Integrator, Derivator, prev_error;
......@@ -199,6 +206,8 @@ int main(void)
p2udt.ScaleA3 = FLT_MAX;
p2udt.ScaleA4 = FLT_MAX;
p2udt.ScaleA5 = FLT_MAX;
p2udt.OvA0 = FLT_MAX;
p2udt.OvA1 = FLT_MAX;
//init IO readback
IOStatus = 0x0;
......@@ -312,7 +321,8 @@ int main(void)
if (SetPoint != p2udt.SetPoint || IOStatus != p2udt.IOStatus || ScaleA0 != p2udt.ScaleA0 ||
ScaleA1 != p2udt.ScaleA1 || ScaleA2 != p2udt.ScaleA2 || ScaleA3 != p2udt.ScaleA3 ||
ScaleA4 != p2udt.ScaleA4 || ScaleA5 != p2udt.ScaleA5) {
ScaleA4 != p2udt.ScaleA4 || ScaleA5 != p2udt.ScaleA5 || OvA0 != p2udt.OvA0 ||
OvA1 != p2udt.OvA1) {
p2udt.SetPoint = SetPoint;
p2udt.IOStatus = IOStatus;
p2udt.ScaleA0 = ScaleA0;
......@@ -321,6 +331,8 @@ int main(void)
p2udt.ScaleA3 = ScaleA3;
p2udt.ScaleA4 = ScaleA4;
p2udt.ScaleA5 = ScaleA5;
p2udt.OvA0 = OvA0;
p2udt.OvA1 = OvA1;
if (pru_rpmsg_send(&transport, dst, src, &p2udt,
sizeof(struct pru2user_data_transfer)) != PRU_RPMSG_SUCCESS) {
// Notification failed
......
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