From 08230d9473ade10bba291b9f336583ff5b4f571c Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Sun, 12 Aug 2018 15:35:02 +0300 Subject: alarm handling (basic) --- Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c | 5 ++++- Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) (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 559db0e79..58d3f9889 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -74,6 +74,8 @@ typedef struct MillisecMessage{ uint32_t Dancer_Data[NUM_OF_DANCERS] = {0}; uint32_t Speed_Data = 0; +bool watchdogCriticalAlarm = false; + MillisecMotorDataStruc MotorData[NUM_OF_MOTORS] = {0}; MillisecMotorDataStruc SpeedSetPending[NUM_OF_MOTORS] = {0}; MillisecMotorDataStruc PT100Data[MAX_TEMPERATURE_SENSOR_ID] = {0}; @@ -417,7 +419,8 @@ uint32_t MillisecLoop(uint32_t tick) for (Sensor_i = 0;Sensor_i < MAX_SYSTEM_DISPENSERS;Sensor_i++) CalculateDispenserPressure(Sensor_i); FPGA_GetAllDispensersValveBusyOCD(); - Control_WD(ENABLE,50); //activate heaters/dispenser watchdog, 5 seconds + if (watchdogCriticalAlarm == false) + Control_WD(ENABLE,50); //activate heaters/dispenser watchdog, 5 seconds } //ROM_IntMasterEnable(); diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h index ef9a9d21b..77c3a5ef8 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h @@ -32,5 +32,7 @@ void MillisecInit(void); void MillisecStop(void); void MillisecStart(void); +extern bool watchdogCriticalAlarm; + extern Task_Handle Millisecond_Task_Handle; #endif /* MODULES_CONTROL_MILLISECTASK_H_ */ -- cgit v1.3.1 From 2054939d97dd0f2b9729781329337868fea1113b Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Mon, 13 Aug 2018 11:20:45 +0300 Subject: heating fix. alarm handling stops pnly active job --- .../Embedded/Modules/AlarmHandling/AlarmHandling.c | 14 ++++++++++---- .../Embedded_SW/Embedded/Modules/Control/MillisecTask.c | 2 +- .../Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c | 4 ++-- .../Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c | 5 ++++- 4 files changed, 17 insertions(+), 8 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Control') diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c index ef95311bb..7a766a552 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c @@ -228,14 +228,20 @@ uint32_t AlarmHandlingConsequentActions(EventType EventId, DebugLogCategory Seve //raise flag fr next job break; case DEBUG_LOG_CATEGORY__Error: - JobEndReason = JOB_OTHER_ALARM; - EndState(NULL,event_type__descriptor.name[EventId]); + if (JobIsActive()) + { + JobEndReason = JOB_OTHER_ALARM; + EndState(NULL,event_type__descriptor.name[EventId]); + } //Stop Job break; case DEBUG_LOG_CATEGORY__Critical: - JobEndReason = JOB_OTHER_ALARM; + if (JobIsActive()) + { + JobEndReason = JOB_OTHER_ALARM; + EndState(NULL,event_type__descriptor.name[EventId]); + } watchdogCriticalAlarm = true; - EndState(NULL,event_type__descriptor.name[EventId]); //stop job //turn machine off break; diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index 9212eb501..75462bd7c 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -102,7 +102,7 @@ void MillisecInit(void) Error_init(&eb); - MillisecMsgQ = Mailbox_create(sizeof(MillisecMessageStruc), 20, NULL,&eb); + MillisecMsgQ = Mailbox_create(sizeof(MillisecMessageStruc), 2, NULL,&eb); for (i=0;i