aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2019-03-19 11:52:26 +0200
committerShlomo Hecht <shlomo@twine-s.com>2019-03-19 11:52:26 +0200
commit98daf1c80688585d2a34586c30a7ac0bf67dd91b (patch)
tree07a2855bef78de5bbc23f75e2481eb01d26b08af /Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
parent06358c97b9fc5e20a25a3035dc4c2f0e0ec8a4c1 (diff)
downloadTango-98daf1c80688585d2a34586c30a7ac0bf67dd91b.tar.gz
Tango-98daf1c80688585d2a34586c30a7ac0bf67dd91b.zip
PreVersion 1.3.8.1 lubrication, IDS presegment improvement start. alarm handling improved, pressure buildup on init, improve centering of drier arm. NON Operative, NOT TESTED!
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
index 0277d1daa..ddcba57bc 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
@@ -137,8 +137,16 @@ uint32_t Winder_PrepareStage2(uint32_t deviceID, uint32_t ReadValue)
//MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_SCREW,InternalWinderCfg.segmentoffsetpulses);
//REPORT_MSG(numOfSteps, "Winder_PrepareStage2");
REPORT_MSG(millisecondCounter/*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].maxfrequency*/, "Winder_PrepareStage2");
-
- status |= MotorMoveWithCallback(HARDWARE_MOTOR_TYPE__MOTO_SCREW, (1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize),numOfSteps, Winder_ScrewAtOffsetCallback,1000);
+ if (ReadValue != LIMIT)
+ {
+ LOG_ERROR(ReadValue,"Screw failed to reach the limit switch!!");
+ //returned with a timeout
+ Winder_ScrewAtOffsetCallback(0,0);
+ }
+ else
+ {
+ status |= MotorMoveWithCallback(HARDWARE_MOTOR_TYPE__MOTO_SCREW, (1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize),numOfSteps, Winder_ScrewAtOffsetCallback,1000);
+ }
//set motor location 0 here
return status;