From 8a28295329b996314caf21b8250bf3a14f375d8a Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Thu, 1 Nov 2018 16:14:14 +0200 Subject: Turn blower off while heating, on after the dryer is on temperature --- .../Embedded/Modules/Thread/Thread_print.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (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 b8be023c9..175cfcc7d 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -315,12 +315,13 @@ uint32_t ThreadControlSpeedReadFunction(uint32_t IfIndex, uint32_t ReadValue) } //double eNormalizedError[100]; //int TranslatedreadValue[100]; -/*double calculatedError[1000]; -int MotorId[1000]; -int readValue[1000]; -int AveragereadValue[1000]; -int calculatedspeed[1000]; -int timestamp[1000];*/ +#define MAX_THREAD_CONTROL_LOG 500 +double calculatedError[MAX_THREAD_CONTROL_LOG]; +int MotorId[MAX_THREAD_CONTROL_LOG]; +int readValue[MAX_THREAD_CONTROL_LOG]; +int AveragereadValue[MAX_THREAD_CONTROL_LOG]; +int calculatedspeed[MAX_THREAD_CONTROL_LOG]; +int timestamp[MAX_THREAD_CONTROL_LOG]; int controlIndex = 0; bool keepdata = true; /*int32_t KeepReadValue = 0; @@ -469,14 +470,14 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) { if (keepdata == true) { - /* calculatedError[controlIndex] = MotorControlConfig[index].m_calculatedError; + calculatedError[controlIndex] = MotorControlConfig[index].m_calculatedError; MotorId[controlIndex] = index; readValue[controlIndex] = ReadValue; AveragereadValue[controlIndex] = avreageSampleValue; calculatedspeed[controlIndex] = calculated_speed; timestamp[controlIndex] = HibernateRTCSSGet(); - if (controlIndex++>=999) - controlIndex = 0;*/ + if (controlIndex++>=MAX_THREAD_CONTROL_LOG) + controlIndex = 0; } CurrentControlledSpeed[index] = calculated_speed; MotorSetSpeed(ThreadMotorIdToMotorId[index], calculated_speed); -- cgit v1.3.1