From a435fa908aa5ef7e167c96866316c2c018f05877 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Sun, 11 Nov 2018 17:30:48 +0200 Subject: remove usb reconnection (only flush buffers). improve thread tracking --- Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread') diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 22f54eb50..24ce14676 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -5,6 +5,7 @@ * operating the dispensers according to predefined dispensing rate from the UI **************************************************************************************************************************/ #include "include.h" +#include #include "thread.h" #include "thread_ex.h" #include "../control/control.h" @@ -317,6 +318,8 @@ uint32_t ThreadControlSpeedReadFunction(uint32_t IfIndex, uint32_t ReadValue) //int TranslatedreadValue[100]; #define MAX_THREAD_CONTROL_LOG 500 double calculatedError[MAX_THREAD_CONTROL_LOG]; +double NormError[MAX_THREAD_CONTROL_LOG]; +double mIntegral[MAX_THREAD_CONTROL_LOG]; int MotorId[MAX_THREAD_CONTROL_LOG]; int readValue[MAX_THREAD_CONTROL_LOG]; int AveragereadValue[MAX_THREAD_CONTROL_LOG]; @@ -475,7 +478,10 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) readValue[controlIndex] = ReadValue; AveragereadValue[controlIndex] = avreageSampleValue; calculatedspeed[controlIndex] = calculated_speed; - timestamp[controlIndex] = HibernateRTCSSGet(); + NormError[controlIndex] + = MotorControlConfig[index].m_mesuredParam; + mIntegral[controlIndex] = MotorControlConfig[index].m_integral; + timestamp[controlIndex] = msec_millisecondCounter; if (controlIndex++>=MAX_THREAD_CONTROL_LOG) controlIndex = 0; } -- cgit v1.3.1