From 8d9c3c149cfc89178859bf0a36a14d5e851be96f Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Tue, 17 Jul 2018 16:49:50 +0300 Subject: fix length calculation. read break sensor and log error change communication tasks priorities --- .../Embedded_SW/Embedded/Modules/Thread/Thread_print.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread') diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 5bf666383..6a0bac394 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -184,6 +184,7 @@ uint32_t ThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue) if (MotorDataIndex == 99) MotorDataIndex = 0; static int pooler_counter = 0; pooler_counter++; + TotalProcessedLength+= (length/100); if (pooler_counter%10 == 0) { if (PrepareState == true) @@ -195,7 +196,6 @@ uint32_t ThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue) } else { - TotalProcessedLength+= (length/100); SendJobProgress(TotalProcessedLength,0,false, "Progress"); } @@ -353,7 +353,18 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) avreageSampleValue += MotorSamples[index][i]; avreageSampleValue = avreageSampleValue / MotorsControl[index].pvinputfilterfactormode; //Stop Execution if the dancer moves too much - + if (index == POOLER_MOTOR) + { + if (JobCounter > eOneSecond) + { + if (ReadBreakSensor()==ERROR) + { + LOG_ERROR(index, "ReadBreakSensor Error"); + //SendJobProgress(0.0,0,false, "ReadBreakSensor Error"); + //EndState(CurrentJob,"ReadBreakSensor Error" ); + } + } + } if ((abs(avreageSampleValue)> DancerStopActivityLimit[index])&&(JobCounter > eOneSecond)) { usnprintf(Message, 60, "Dancer %d limit %d value %d Zero %d",DancerId,DancerStopActivityLimit[index],avreageSampleValue,DancersCfg[DancerId].zeropoint); -- cgit v1.3.1