From 3640afb74b3e7b3e232f56a14104866690495c9a Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Mon, 18 Jun 2018 12:31:20 +0300 Subject: Motor Control Fixed, new winder works, CurrentJob holds the job request message --- Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c') 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) -- cgit v1.3.1