diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2019-03-10 09:06:35 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2019-03-10 09:06:35 +0200 |
| commit | abc70316f80a9cb05b320828051bb7dcbfeaad1b (patch) | |
| tree | a334c1cc23b307710f6338523e5c20fb09017665 /Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c | |
| parent | cbdd79778764ce38017790e1e1f9316e52ec8104 (diff) | |
| parent | 7256fe1c07cf5ecbe485c3cdac238b88dfc2cd1d (diff) | |
| download | Tango-abc70316f80a9cb05b320828051bb7dcbfeaad1b.tar.gz Tango-abc70316f80a9cb05b320828051bb7dcbfeaad1b.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index 2689ea34a..a82fe37e6 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -199,6 +199,7 @@ return OK; } uint8_t CallbackCounter = 0; + uint8_t TimeoutsCounter = 0; uint32_t Thread_Load_HomingCallback(uint32_t MotorId, uint32_t ReadValue) { Report("Thread Load State Machine Callback.",__FILE__,__LINE__,LoadStages,RpMessage,NumberOfDrierLoaderCycles,0); @@ -206,12 +207,25 @@ if (CallbackCounter) { CallbackCounter--; + if (ReadValue != LIMIT) + { + //returned with a timeout + TimeoutsCounter++; + } if (CallbackCounter == 0) { - LoadStages++; - if (LoadStages != THREAD_LOAD_INITIAL_TENSION) //on this satge we should wait for user call + if (TimeoutsCounter) { - //ThreadLoadStateMachine(LoadStages); + LOG_ERROR(LoadStages,"Load sequence timeout"); + TimeoutsCounter = 0; + } + else + { + LoadStages++; + if (LoadStages != THREAD_LOAD_INITIAL_TENSION) //on this satge we should wait for user call + { + ThreadLoadStateMachine(LoadStages); + } } } } @@ -326,7 +340,7 @@ { Control_Dryer_Fan(START,75);//use START or STOP, 0 - 100% LoadStages++; - //ThreadLoadStateMachine(LoadStages); + ThreadLoadStateMachine(LoadStages); } return OK; } @@ -357,7 +371,7 @@ LoadStages++; if (LoadStages != THREAD_LOAD_INITIAL_TENSION) //on this satge we should wait for user call { - //ThreadLoadStateMachine(LoadStages); + ThreadLoadStateMachine(LoadStages); } } } @@ -414,7 +428,7 @@ ControlId = 0xFF; ThreadAbortJoggingFunc(); LoadStages++; - //ThreadLoadStateMachine(LoadStages); + ThreadLoadStateMachine(LoadStages); return OK; } uint32_t Thread_Load_Jog_Thread(void) |
