Commit 65e0f22f authored by Alessio Igor Bogani's avatar Alessio Igor Bogani
Browse files

Enable remoteproc on ControlLoop

parent 7013871f
......@@ -116,10 +116,12 @@ volatile float OutputCurrent;
struct pru2pru_data_transfer {
float OCnorm;
} p2pdt;
struct pru2user_data_transfer {
float SetPoint;
unsigned int IOStatus;
} p2udt;
};
struct pru2user_data_transfer p2udt;
volatile float SetPoint;
volatile unsigned int IOStatus;
......@@ -196,8 +198,10 @@ int main(void)
/* Check bit 30 of register R31 to see if the ARM has kicked us */
if (__R31 & HOST_INT) {
/* Clear the event status */
CT_INTC.SICR_bit.STS_CLR_IDX = FROM_ARM_HOST;
break;
if (pru_rpmsg_receive(&transport, &src, &dst, NULL, &len) == PRU_RPMSG_SUCCESS) {
CT_INTC.SICR_bit.STS_CLR_IDX = FROM_ARM_HOST;
break;
}
}
}
......@@ -281,18 +285,18 @@ int main(void)
}
ReadIO();
}
#if 0
Debug0++; // Cycle counter
Debug0++; // Cycle
if (SetPoint != p2udt.SetPoint || IOStatus != p2udt.IOStatus) {
Debug1++; // Change counter
Debug1++; // Change
p2udt.SetPoint = SetPoint;
p2udt.IOStatus = IOStatus;
if (pru_rpmsg_receive(&transport, &src, &dst, &p2udt, &len) == PRU_RPMSG_SUCCESS) {
Debug2++; // Change notification
pru_rpmsg_send(&transport, dst, src, &p2udt, len);
Debug2++; // Notification
if (pru_rpmsg_send(&transport, dst, src, &p2udt,
sizeof(struct pru2user_data_transfer)) != PRU_RPMSG_SUCCESS) {
Debug3++; // Notification failed
}
}
#endif
}
}
......
......@@ -297,7 +297,6 @@ int main(void)
Debug2++; // Notification
if (pru_rpmsg_send(&transport, dst, src, &p2udt,
sizeof(struct pru2user_data_transfer) * SAMPLES) != PRU_RPMSG_SUCCESS) {
// FIXME Is it works? Or always return success?
Debug3++; // Notifications 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