From e67d15360ce355ac9e675079cd5d6442e3fa1905 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Thu, 8 Nov 2018 11:23:48 +0200 Subject: fix bugs --- Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.new | 7 +++++++ Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'Software/Embedded_SW') diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.new b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.new index ba4a5c8e0..f33a134e1 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.new +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.new @@ -32,6 +32,7 @@ uint32_t Winder_ScrewAtOffsetCallback(uint32_t deviceID, uint32_t BusyFlag); uint32_t Winder_PrepareStage2(uint32_t deviceID, uint32_t ReadValue); bool ScrewCurrentDirection = false; //holds current screw direction +bool BusyfirstCall = true; //Ignores first call after activating the screw - too early double ScrewSpeed = 0; double ScrewRunningTime = 0; bool ScrewDirection = false; @@ -210,6 +211,12 @@ uint32_t ScrewDirectionChange(uint32_t deviceID, uint32_t BusyFlag) { uint32_t Steps; double temp; + if (BusyfirstCall) + { + BusyfirstCall = false; + DirectionChangeCounter++; + return OK; + } //ScrewCurrentDirection: false moves out, true moves home if (BusyFlag == NOTBUSY) { diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c index f4b83a3cf..f0415fac1 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c @@ -755,7 +755,7 @@ Void jobTask(UArg arg0, UArg arg1) if (CurrentRequest!= NULL) job_request__free_unpacked(CurrentRequest,NULL); CurrentRequest = NULL; - SuspendLargeMessages = true; + SuspendLargeMessages = false; //CleanState(CurrentJob); break; case PrintingResultsFail: @@ -764,6 +764,7 @@ Void jobTask(UArg arg0, UArg arg1) if (CurrentRequest!= NULL) job_request__free_unpacked(CurrentRequest,NULL); CurrentRequest = NULL; + SuspendLargeMessages = false; //send message data as a validation error message to host ExitState(Message.messageData); break; -- cgit v1.3.1