From 99c3ca5c084ebee576dea0adc64b498133ff6939 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Thu, 21 Jun 2018 18:12:50 +0300 Subject: warnings --- .../Embedded/Modules/Control/MillisecTask.c | 27 ++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c') diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index 1f48d5953..a00c23739 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -80,13 +80,15 @@ Mailbox_Handle MotorsMsgQ[NUM_OF_MOTORS] = {NULL}; bool MillisecRestart; static GateMutex_Handle gateMillisecDB; -uint32_t MillisecDatalog[MAX_TANGO_CONTROL_DEVICES]; uint32_t Millisec_timerBase = TIMER1_BASE; //Timer handle /******************** Functions ********************************************/ uint32_t Control_Delta_Position_Pass(uint32_t Current_Read,uint32_t Previous_Read); //********************************************************************** /******************** CODE ********************************************/ //********************************************************************** +uint32_t MSBacklog[1000]={0}; +uint8_t Motor_Id[1000]={0}; +uint16_t MsecLogindex = 0; void MillisecInit(void) { @@ -103,7 +105,6 @@ void MillisecInit(void) MillisecRestart = false; - memset(MillisecDatalog,0,sizeof(uint32_t)*MAX_TANGO_CONTROL_DEVICES); gateMillisecDB = GateMutex_create(NULL, &eb); if (gateMillisecDB == NULL) @@ -182,6 +183,14 @@ uint32_t MotorActivity = 0; int32_t MillisecSetMotorSpeed(TimerMotors_t MotorId, unsigned long Data, int Length, MSecFptr Callback) { if (MotorId >= NUM_OF_MOTORS) return -1; + //========================== + MSBacklog[MsecLogindex]=Data; + Motor_Id[MsecLogindex]=MotorId; + MsecLogindex++; + if (MsecLogindex>=999) + MsecLogindex = 0; + //========================== + SpeedSetPending[MotorId].Callback = Callback; SpeedSetPending[MotorId].Data = Data; SpeedSetPending[MotorId].Length = Length; @@ -209,6 +218,13 @@ int MillisecFlushMsgQ(TimerMotors_t MotorId) int32_t MillisecWriteToMotor(TimerMotors_t MotorId, unsigned long Data, int Length, MSecFptr Callback) { MillisecMotorDataStruc MotorData = {0}; + //========================== + MSBacklog[MsecLogindex]=Data; + Motor_Id[MsecLogindex]=MotorId; + MsecLogindex++; + if (MsecLogindex>=999) + MsecLogindex = 0; + //========================== if (MotorId >= NUM_OF_MOTORS) return -1; MotorActivity++; MotorData.Callback = Callback; @@ -223,6 +239,13 @@ int32_t MillisecReadFromMotor(TimerMotors_t MotorId, unsigned long Data, int Len { MillisecMotorDataStruc MotorData = {0}; if (MotorId >= NUM_OF_MOTORS) return -1; +//========================== + MSBacklog[MsecLogindex]=Data; + Motor_Id[MsecLogindex]=MotorId; + MsecLogindex++; + if (MsecLogindex>=999) + MsecLogindex = 0; + //========================== MotorActivity++; MotorActivity++; MotorData.Callback = Callback; -- cgit v1.3.1