From 383332c5ff77d9d8ea0532e5f04c23217563ab30 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Sun, 22 Sep 2019 11:09:01 +0300 Subject: handle safety alarms, log winder better. --- Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (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 20045e5fb..4cbe1f70f 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -322,7 +322,7 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) #ifdef READ_SCREW_ENCODER int WinderRun; WinderRun = abs(ScrewLocationRun[1] - ScrewLocationRun[0]); - if /*((WinderRun < 50000)&&(Add100 == false))*/(Add100 == false) + if ((WinderRun < 50000)&&(Add100 == false)) { WinderRunSum+=WinderRun; WinderRunSamples++; @@ -334,6 +334,9 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) Report(ScrewStr,__FILE__,__LINE__,CalculationDirectionChangeCounter,RpWarning,ScrewLocationStart, 0); } } + else + Report("winder run error value" ,__FILE__,WinderRun,ScrewLocationRun[0],RpWarning,ScrewLocationRun[1], 0); + //Report(ScrewStr,__FILE__,__LINE__,CalculationDirectionChangeCounter,RpWarning,ScrewLocationStart, 0); //REPORT_MSG(abs(ScrewLocationRun[1] - ScrewLocationRun[0]), "Screw Run NumberOfSteps"); //usnprintf(ScrewStr, 100, "Winder Encoder: 0 0x%x 1 0x%x diff %d intent %d rot %d",ScrewLocationRun[0],ScrewLocationRun[1],abs(ScrewLocationRun[1] - ScrewLocationRun[0]),ScrewNumberOfSteps,Rotations*10); -- cgit v1.3.1