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.c5
1 files changed, 3 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 e99d3df0b..3505ff3c6 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
@@ -111,7 +111,7 @@ uint32_t ScrewDirectionChange(uint32_t deviceID, uint32_t BusyFlag)
if (BusyfirstCall)
{
BusyfirstCall = false;
- return;
+ return OK;
}
//ScrewCurrentDirection: false moves out, true moves home
if (BusyFlag == NOTBUSY)
@@ -182,7 +182,8 @@ uint32_t Winder_End(void)
{
//stop screw
ScrewNumberOfSteps = 0;
- RemoveControlCallback(ScrewControlId,ScrewDirectionChange);
+ if (ScrewControlId != 0xFF)
+ RemoveControlCallback(ScrewControlId,ScrewDirectionChange);
return MotorStop (HARDWARE_MOTOR_TYPE__MOTO_SCREW,Hard_Hiz);
}
void Winder_ScrewHomeLimitSwitchInterrupt(void)