aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
index 8ecb3f404..011488c49 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
@@ -221,6 +221,7 @@ uint32_t Winder_Prepare(void *JobDetails)
{
//REPORT_MSG(LIMIT, "Winder_Prepare at limit");
Winder_PrepareStage2(0,0);
+ Screw_wait_counter=1;
}
else
{
@@ -229,15 +230,42 @@ uint32_t Winder_Prepare(void *JobDetails)
//REPORT_MSG(MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize, "Winder_Prepare move to limit");
Screw_wait_counter=1;
status = MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_SCREW,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_SCREW].directionthreadwize, ScrewSpeed, GPI_LS_SCREW_RIGHT, Winder_PrepareStage2,2000);
+ }
#ifdef FOUR_WINDERS
+ if (FPGA_Read_limit_Switches(GPI_LS_SPARE2_2)==LIMIT)
+ {
+ Winder_PrepareStage2(0,0);
+ Screw_wait_counter++;
+ }
+ else
+ {
+ Winder_ScrewHoming = true;
Screw_wait_counter++;
status = MotorMovetoLimitSwitch (SCREW_2_Motor,MotorsCfg[SCREW_2_Motor].directionthreadwize, ScrewSpeed, GPI_LS_SPARE2_2, Winder_PrepareStage2,2000);
+ }
+ if (FPGA_Read_limit_Switches(GPI_LS_SPARE1_2)==LIMIT)
+ {
+ Winder_PrepareStage2(0,0);
+ Screw_wait_counter++;
+ }
+ else
+ {
+ Winder_ScrewHoming = true;
Screw_wait_counter++;
status = MotorMovetoLimitSwitch (SCREW_3_Motor,MotorsCfg[SCREW_3_Motor].directionthreadwize, ScrewSpeed, GPI_LS_SPARE1_2, Winder_PrepareStage2,2000);
+ }
+ if (FPGA_Read_limit_Switches(GPI_LS_RDANCER_UP)==LIMIT)
+ {
+ Winder_PrepareStage2(0,0);
+ Screw_wait_counter++;
+ }
+ else
+ {
+ Winder_ScrewHoming = true;
Screw_wait_counter++;
status = MotorMovetoLimitSwitch (SCREW_4_Motor,MotorsCfg[SCREW_4_Motor].directionthreadwize, ScrewSpeed, GPI_LS_RDANCER_UP, Winder_PrepareStage2,2000);
-#endif
}
+#endif
return status;
}
/*