From 5818548b366bb5a31ab04e8960bd37f739242592 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Mon, 6 Aug 2018 07:56:31 +0300 Subject: real time improvement, screw speed recalculated --- Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c') diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 8d1ea20fa..d56ff34cf 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -127,8 +127,8 @@ void ThreadUpdateProcessLength (double length, void *Funcptr) ProcessedLengthFuncPtr = (ProcessedLengthFunc)Funcptr; initialpos = 0xFFFF; } -double MotorSentData[102] = {0}; -uint32_t PosDif[102] = {0}; +double MotorSentData[100] = {0}; +uint32_t PosDif[100] = {0}; int MotorDataIndex = 0; @@ -181,7 +181,7 @@ uint32_t ThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue) //PosDif[MotorDataIndex] = positionDiff; MotorSentData[MotorDataIndex] = length; MotorDataIndex+=1; - if (MotorDataIndex >= 97) MotorDataIndex = 0; + if (MotorDataIndex == 99) MotorDataIndex = 0; static int pooler_counter = 0; pooler_counter++; TotalProcessedLength+= (length/100); @@ -415,6 +415,10 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) } //******************************************************************************************************************** +uint32_t ThreadGetMotorSpeed(threadMotorsEnum MotorId) +{ + return CurrentControlledSpeed[MotorId]; +} //******************************************************************************************************************** uint32_t ThreadInitialTestStub(HardwareMotor * request) -- cgit v1.3.1