From abc2f5fc8f757eddeccdd10646039c96b58e522d Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Tue, 13 Aug 2019 19:27:10 +0300 Subject: Version 1.4.3.7 Power off sequence with flushing and cleaning job. VOC alarms, safety, auto filling dispensers --- Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c | 9 +++++---- Software/Embedded_SW/Embedded/Modules/Control/control.c | 8 ++++++++ Software/Embedded_SW/Embedded/Modules/Control/control.h | 1 + 3 files changed, 14 insertions(+), 4 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Control') diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index f5ac6cf92..fa94614fd 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -88,14 +88,13 @@ uint32_t Dancer_Data[NUM_OF_DANCERS] = {0}; float Speed_Data = 0; uint32_t DrawerFansStatus = 0; uint32_t SystemFansStatus = 0; -uint8_t Gas_PPM = 0; - bool watchdogCriticalAlarm = false; uint32_t msec_millisecondCounter = 0; extern bool Machine_Idle_Mode; +uint8_t Gas_PPM_Info; MillisecMotorDataStruc ScrewSetMaxSpeedPending = {0}; MillisecMotorDataStruc ScrewMovePending = {0}; MillisecMotorDataStruc MotorData[NUM_OF_MOTORS] = {0}; @@ -111,6 +110,7 @@ static GateMutex_Handle gateMillisecDB; uint32_t Millisec_timerBase = TIMER1_BASE; //Timer handle /******************** Functions ********************************************/ uint32_t Control_Delta_Position_Pass(uint32_t Current_Read,uint32_t Previous_Read); +void CalculateVOCAlarms(void); //********************************************************************** /******************** CODE ********************************************/ //********************************************************************** @@ -595,7 +595,6 @@ uint32_t MillisecLowLoop(uint32_t tick) Read_Heaters_Current(Heater_i); } } - Gas_PPM = Calculate_Gas_Power_Consumption(); for (Sensor_i = 0;Sensor_i < MAX_TEMPERATURE_SENSOR_ID;Sensor_i++) { TemperatureCalc[Sensor_i] = MillisecCalculateTemperatures ( Sensor_i); @@ -615,6 +614,8 @@ uint32_t MillisecLowLoop(uint32_t tick) MotorGetStatusFromFPGA(Motor_i); }*/ midtankDisplay = 1-midtankDisplay; + Gas_PPM_Info = Calculate_Gas_Power_Consumption(); + } if (OneHourTick) { @@ -720,7 +721,7 @@ uint32_t getDrawerFansStatus(void) } uint8_t getGasReading(void) { - return Gas_PPM; + return Gas_PPM_Info; } uint32_t getSystemFansStatus(void) diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c index f1e19d851..a88f67d5e 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c @@ -479,6 +479,14 @@ uint32_t GetControlLowDevice_i(void) { return ControlLowDevice_i; } +ControlCBFunction GetControlCallbackFuncPtr(uint32_t ControlId) +{ + if (ControlArray[ControlId].ControlActive) + return ControlArray[ControlId].ControlCallbackPtr; + else + return NULL; + +} uint32_t ControlLoop(uint32_t tick) { if (MaxHighDevices == 0xFF) diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.h b/Software/Embedded_SW/Embedded/Modules/Control/control.h index 380040e34..c54909f73 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.h +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.h @@ -47,6 +47,7 @@ int SafeRemoveHighControlCallback(uint32_t deviceId , ControlCBFunction uint32_t TemplateDataReadCBFunction (uint32_t deviceId, uint32_t Parameter1); uint32_t GetControlDevice_i(void); uint32_t GetControlLowDevice_i(void); +ControlCBFunction GetControlCallbackFuncPtr(uint32_t ControlId); extern Task_Handle Control_Task_Handle; extern uint32_t millisecondCounter; -- cgit v1.3.1