aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
index 576a2bd5a..28e2ecdf0 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
@@ -70,10 +70,12 @@ double TotalProcessedLength = 0.0;
double LengthCalculationMultiplier;
uint32_t PoolerPreviousPosition = 0, PoolerCurrentPosition = 0;
-double PoolerCurrentProcessedLength = 0.0;
double PoolerTotalProcessedLength = 0.0;
double PoolerLengthCalculationMultiplier;
+double TempPoolerTotalProcessedLength = 0.0;
+double TempTotalProcessedLength = 0.0;
+
bool PrepareState = false;
int CurrentSegmentId = 0;
typedef void (* ProcessedLengthFunc)(void);
@@ -132,7 +134,6 @@ void ThreadUpdateProcessLength (double length, void *Funcptr)
{
CurrentRequestedLength = length*100;//Centimetres
CurrentProcessedLength = 0;
- PoolerCurrentProcessedLength = 0;
ProcessedLengthFuncPtr = (ProcessedLengthFunc)Funcptr;
initialpos = 0xFFFF;
Poolerinitialpos = 0xFFFF;
@@ -184,6 +185,7 @@ uint32_t ThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue)
static int pooler_counter = 0;
pooler_counter++;
TotalProcessedLength+= (length/100);
+ TempTotalProcessedLength = TotalProcessedLength;
if (pooler_counter%10 == 0)
{
if (PrepareState == true)
@@ -247,7 +249,8 @@ uint32_t PoolerThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue)
PoolerPreviousPosition = PoolerCurrentPosition;
length = (double)(positionDiff)*PoolerLengthCalculationMultiplier;
- PoolerCurrentProcessedLength+=length;
+ PoolerTotalProcessedLength+= (length/100);
+ TempPoolerTotalProcessedLength = PoolerTotalProcessedLength;
return OK;
}