aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-07-24 15:05:40 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-07-24 15:05:40 +0300
commitfd81643e32328a0d548c7cebdba008050ae03673 (patch)
tree852fd07c35c800cc21de995a767805c033c37658 /Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
parent07e200a598d01c7bb5a2b82dfdb3b99cf24f76e9 (diff)
parent1a4e2e8a731c7d4c6150de73b36b7c40d6422cd7 (diff)
downloadTango-fd81643e32328a0d548c7cebdba008050ae03673.tar.gz
Tango-fd81643e32328a0d548c7cebdba008050ae03673.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
index eb1b751bb..528b83c1c 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
@@ -539,6 +539,25 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue)
}
BreakSensorCounter = 0;
}
+ if (CurrentControlledSpeed[index] < (OriginalMotorSpd_2PPS[index]/3))
+ {
+ BreakSensorCounter++;
+ BreakSensorLatchCounter++;
+ if (BreakSensorCounter>=BreakSensordebouncetimemilli)
+ {
+ //consider applying the debouce parameters later
+ usnprintf(TMessage, 60, "thread speed too low");
+ JobEndReason = JOB_THREAD_BREAK;
+ ThreadControlActive = false;
+ SendJobProgress(0.0,0,false, TMessage);
+ SendSegmentFail();
+ //AlarmHandlingSetAlarm(EVENT_TYPE__THREAD_BREAK,true);
+ //EndState(CurrentJob,"ReadBreakSensor Error" );
+ LOG_ERROR(index, "thread speed too low Error");
+ return OK;
+ }
+ }
+
}
}
}