diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2019-02-27 16:06:23 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2019-02-27 16:06:23 +0200 |
| commit | da1b671bef36b771d7c417baadd8156287d481d2 (patch) | |
| tree | c16080fab64d8891551808a7911270288d5c0480 /Software/Embedded_SW/Embedded | |
| parent | dcaadc1886a2f5169821ba568a78990cc6ced4bc (diff) | |
| download | Tango-da1b671bef36b771d7c417baadd8156287d481d2.tar.gz Tango-da1b671bef36b771d7c417baadd8156287d481d2.zip | |
automstic loading
Diffstat (limited to 'Software/Embedded_SW/Embedded')
| -rw-r--r-- | Software/Embedded_SW/Embedded/.cproject | 1 | ||||
| -rw-r--r-- | Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c | 5 | ||||
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c | 26 |
3 files changed, 25 insertions, 7 deletions
diff --git a/Software/Embedded_SW/Embedded/.cproject b/Software/Embedded_SW/Embedded/.cproject index d1abfd6c1..ae0630bbb 100644 --- a/Software/Embedded_SW/Embedded/.cproject +++ b/Software/Embedded_SW/Embedded/.cproject @@ -65,6 +65,7 @@ <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Communication}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Common}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}}/Modules""/> + <listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> <listOptionValue builtIn="false" value=""${TIVAWARE_DRIVERS}""/> <listOptionValue builtIn="false" value=""C:\ti\xdctools_3_32_00_06_core\include""/> <listOptionValue builtIn="false" value=""${COM_TI_RTSC_TIRTOSTIVAC_INSTALL_DIR}/products/TivaWare_C_Series-2.1.1.71b""/> diff --git a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c index c9a6391c3..27f7f2a52 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c +++ b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c @@ -366,9 +366,12 @@ uint32_t MotorMovetoLimitSwitch (TimerMotors_t MotorId,bool direction, uint32_t MotorTimeLag[MotorId] = eTenMillisecond; MotorTimeLimit[MotorId] = timeout; + if ((MotorId == HARDWARE_MOTOR_TYPE__MOTO_DH_CLEANHEAD)||(HARDWARE_MOTOR_TYPE__MOTO_DH_CLEANMECH)) + MotorTimeLag[MotorId] = 2; + MotorSetDirection( MotorId, direction); MotorSetSpeed(MotorId, Freq); - MotorControlId[MotorId] = AddControlCallback( MotorMoveToLimitSwitchCallBackFunction, eTenMillisecond , FPGA_Read_limit_Switches,(IfTypeMotors*0x100+MotorId), LimitSwitchId, 0 ); + MotorControlId[MotorId] = AddControlCallback( MotorMoveToLimitSwitchCallBackFunction, MotorTimeLag[MotorId] , FPGA_Read_limit_Switches,(IfTypeMotors*0x100+MotorId), LimitSwitchId, 0 ); if ( MotorControlId[MotorId] == 0xFF) return ERROR; MotorCallback[MotorId] = callback; 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) |
