aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2020-12-02 19:56:02 +0200
committerShlomo Hecht <shlomo@twine-s.com>2020-12-02 19:56:02 +0200
commit61b72c2bcb2798f7b0d96f1b4ccb5e176b2051dc (patch)
treed387095cc3ea40a03eb2ddd2e18d47281c32fd3d /Software/Embedded_SW/Embedded/Modules/Thread
parentfbfe1b3cc3024a6b0401fb0a2c53bead70462338 (diff)
downloadTango-61b72c2bcb2798f7b0d96f1b4ccb5e176b2051dc.tar.gz
Tango-61b72c2bcb2798f7b0d96f1b4ccb5e176b2051dc.zip
thread loading fixes
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
index f2ca4e8d7..f327ef3b2 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c
@@ -258,12 +258,14 @@
{
CallbackCounter--;
}
- if ((abs(angle)>14000 )&&(BusyFlag == NOTBUSY)) // OK - take another round
+ if ((abs(angle)<200 )&&(BusyFlag == NOTBUSY)) // OK
{
Report("Thread_Load_Set_Load_Arm_To_Stopper time",__FILE__,msec_millisecondCounter - UnloadingStart,msec_millisecondCounter,RpMessage,UnloadingStart,0);
Report("Thread_Load_Set_Load_Arm_To_Stopper_Callback",__FILE__,__LINE__,LoadStages,RpMessage,CallbackCounter,0);
NumberOfDrierLoaderCycles=0;
+ MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,0);
+
//storeLoadArmParameters();
LoadStages++;
@@ -272,7 +274,7 @@
else
{
load.color = fastBILNK;
- usnprintf(LoadErrorMsg, 100, "Stage %s - %s timeout",LoadStagesStr[LoadStages], MotorStr[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM]);
+ usnprintf(LoadErrorMsg, 100, "*Stage %s - %s timeout",LoadStagesStr[LoadStages], MotorStr[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM]);
Report(LoadErrorMsg,__FILE__,__LINE__,LoadStages,RpWarning,TimeoutsCounter,0);
LoadStatus = ERROR;
@@ -317,7 +319,7 @@
{
TimeoutsCounter = 0;
load.color = fastBILNK;
- usnprintf(LoadErrorMsg, 100, "Stage %s - %s timeout",LoadStagesStr[LoadStages], MotorStr[MotorId]);
+ usnprintf(LoadErrorMsg, 100, "/Stage %s - %s timeout",LoadStagesStr[LoadStages], MotorStr[MotorId]);
Report(LoadErrorMsg,__FILE__,__LINE__,LoadStages,RpWarning,TimeoutsCounter,0);
LoadStatus = ERROR;
@@ -687,7 +689,7 @@
TimeoutsCounter = 0;
CallbackCounter = 0;
load.color = fastBILNK;
- usnprintf(LoadErrorMsg, 100, "Stage %s - Dryer load arm timeout",LoadStagesStr[LoadStages]);
+ usnprintf(LoadErrorMsg, 100, "$Stage %s - Dryer load arm timeout",LoadStagesStr[LoadStages]);
Report(LoadErrorMsg,__FILE__,__LINE__,LoadStages,RpWarning,TimeoutsCounter,0);
LoadStatus = ERROR;
MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, 200);
@@ -729,6 +731,13 @@
{
LoadArmRounds -= CurrentlyLoaded;
}
+ if (LoadArmRounds == CurrentlyLoaded)
+ {
+ Report("Thread_Load_Dryer_Loading no need for cycles",__FILE__,__LINE__,LoadStages,RpMessage,CallbackCounter,0);
+ LoadStages++;
+ ThreadLoadStateMachine(LoadStages);
+ return OK;
+ }
ThreadMotorIdToMotorId[FEEDER_MOTOR] = HARDWARE_MOTOR_TYPE__MOTO_RDRIVING ;
ThreadMotorIdToMotorId[DRYER_MOTOR] = HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING;
@@ -932,7 +941,7 @@
MotorStop(HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING,Hard_Hiz);
load.color = fastBILNK;
- usnprintf(LoadErrorMsg, 100, "Stage %s - Dryer load arm timeout",LoadStagesStr[LoadStages]);
+ usnprintf(LoadErrorMsg, 100, "&Stage %s - Dryer load arm timeout",LoadStagesStr[LoadStages]);
Report(LoadErrorMsg,__FILE__,__LINE__,LoadStages,RpWarning,TimeoutsCounter,0);
Report("Dryer unloading timeout(1) or no movement",__FILE__,temp,DrierPrevLocation,RpWarning,ReadValue,0);
LoadStatus = ERROR;
@@ -1489,6 +1498,8 @@ uint32_t ThreadLoadingRestartReport(void) //sending after a failure in the final
if (ThreadLoadingToken[0] == 0)
return OK;
+ if (LoadStages == THREAD_LOAD_INIT)
+ return OK;
ThreadLoadingRestartFlag = true;
response.has_state = true;