diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-09-05 12:50:10 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-09-05 12:50:10 +0300 |
| commit | fdb22013526ea2d6cbd39df77b87f25e6197e081 (patch) | |
| tree | 3ae08e7eda1e2ba798e586f442b73fc476bd1c2c /Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c | |
| parent | cbe023d4bf6a1556deee770db4f6a7d1d2fa3af4 (diff) | |
| download | Tango-fdb22013526ea2d6cbd39df77b87f25e6197e081.tar.gz Tango-fdb22013526ea2d6cbd39df77b87f25e6197e081.zip | |
streamline all job actions (end, abort) htrough the process task.
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 54a47e927..69eafe152 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -377,10 +377,13 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) { //consider applying the debouce parameters later //BreakSensordebouncetimemilli - //LOG_ERROR(index, "ReadBreakSensor Error"); JobEndReason = JOB_THREAD_BREAK; - //SendJobProgress(0.0,0,false, "ReadBreakSensor Error"); - EndState(CurrentJob,"ReadBreakSensor Error" ); + ThreadControlActive = false; + SendJobProgress(0.0,0,false, "ReadBreakSensor Error"); + SegmentReady(Module_Thread,ModuleFail); + //EndState(CurrentJob,"ReadBreakSensor Error" ); + LOG_ERROR(index, "ReadBreakSensor Error"); + return OK; } } } @@ -390,9 +393,14 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) 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); - JobAbortedByUser = true; + //JobAbortedByUser = true; + ThreadControlActive = false; JobEndReason = JOB_DANCER_FAIL; - EndState(CurrentJob,Message ); + SendJobProgress(0.0,0,false, Message); + //EndState(CurrentJob,Message ); + SegmentReady(Module_Thread,ModuleFail); + LOG_ERROR (index, "Dancer Failure"); + return OK; } NormalizedError = avreageSampleValue*NormalizedErrorCoEfficient[index]; MotorControlConfig[index].m_mesuredParam = NormalizedError; |
