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) --- .../Embedded/Modules/AlarmHandling/AlarmHandling.c | 261 ++++++++++++++++++++- .../Embedded/Modules/AlarmHandling/AlarmHandling.h | 4 + .../Embedded/Modules/Control/MillisecTask.c | 5 +- .../Embedded/Modules/Control/MillisecTask.h | 2 + .../Embedded/Modules/Diagnostics/Diagnostics.c | 12 +- .../Embedded/Modules/General/GeneralHardware.c | 2 + 6 files changed, 280 insertions(+), 6 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c index 0ea10bafc..ef95311bb 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c @@ -16,6 +16,7 @@ #include "drivers/adc_sampling/adc.h" #include "Control/control.h" +#include "Control/MillisecTask.h" #include "drivers/Motors/Motor.h" #include "drivers/Heater/TemperatureSensor.h" @@ -25,12 +26,15 @@ #include "PMR/Hardware/HardwareDancerType.pb-c.h" #include "modules/thread/thread_ex.h" +#include "modules/ids/ids_ex.h" #include #include #include "PMR/debugging/DebugLogCategory.pb-c.h" #include "StateMachines/Printing/PrintingSTM.h" +#include "drivers/FPGA/Moters_Driver/L6470.h" + Task_Handle AlarmHandling_Task_Handle; Mailbox_Handle AlarmHandlingMsgQ = NULL; @@ -50,7 +54,105 @@ typedef struct AlarmHandlingMessage{ uint8_t messageData[20]; }AlarmHandlingMessageStruc; - +#define MAX_SYSTEM_ALARMS 200 +typedef enum +{ + TemperatureAlarm, + LimitSwitchAlarm, + PressureAlarm, + CurrentAlarm, + MotorAlarm +}AlarmSource; +#define OVER_VALUE true; +#define UNDER_VALUE false; +typedef struct +{ + uint16_t Frequency; //1/10/100/1000 + AlarmSource AlarmSource; + uint16_t DeviceId; + uint32_t AlarmValue; + bool AlarmDirection; + DebugLogCategory Severity; + uint16_t Predecessor; + uint8_t DebounceValue; + int8_t DebounceCounter; + bool Status; + EventType EventType; +}AlarmHandlingItem; +AlarmHandlingItem AlarmItem[MAX_SYSTEM_ALARMS]={ +{100,LimitSwitchAlarm,GPI_LS_DISPENSER_UP_1,true,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__DispenserEmpty}, +{100,LimitSwitchAlarm,GPI_LS_DISPENSER_UP_2,true,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__DispenserEmpty}, +{100,LimitSwitchAlarm,GPI_LS_DISPENSER_UP_3,true,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__DispenserEmpty}, +{100,LimitSwitchAlarm,GPI_LS_DISPENSER_UP_4,true,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__DispenserEmpty}, +{100,LimitSwitchAlarm,GPI_LS_DISPENSER_UP_5,true,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__DispenserEmpty}, +{100,LimitSwitchAlarm,GPI_LS_DISPENSER_UP_6,true,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__DispenserEmpty}, +{100,LimitSwitchAlarm,GPI_LS_DISPENSER_UP_7,true,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__DispenserEmpty}, +{100,LimitSwitchAlarm,GPI_LS_DISPENSER_UP_8,true,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__DispenserEmpty}, +{100,LimitSwitchAlarm,GPI_LS_DISPENSER_25_1,true,true,DEBUG_LOG_CATEGORY__Warning,0,0,0,false,EVENT_TYPE__DispenserLowLevel}, +{100,LimitSwitchAlarm,GPI_LS_DISPENSER_25_2,true,true,DEBUG_LOG_CATEGORY__Warning,1,0,0,false,EVENT_TYPE__DispenserLowLevel}, +{100,LimitSwitchAlarm,GPI_LS_DISPENSER_25_3,true,true,DEBUG_LOG_CATEGORY__Warning,2,0,0,false,EVENT_TYPE__DispenserLowLevel}, +{100,LimitSwitchAlarm,GPI_LS_DISPENSER_25_4,true,true,DEBUG_LOG_CATEGORY__Warning,3,0,0,false,EVENT_TYPE__DispenserLowLevel}, +{100,LimitSwitchAlarm,GPI_LS_DISPENSER_25_5,true,true,DEBUG_LOG_CATEGORY__Warning,4,0,0,false,EVENT_TYPE__DispenserLowLevel}, +{100,LimitSwitchAlarm,GPI_LS_DISPENSER_25_6,true,true,DEBUG_LOG_CATEGORY__Warning,5,0,0,false,EVENT_TYPE__DispenserLowLevel}, +{100,LimitSwitchAlarm,GPI_LS_DISPENSER_25_7,true,true,DEBUG_LOG_CATEGORY__Warning,6,0,0,false,EVENT_TYPE__DispenserLowLevel}, +{100,LimitSwitchAlarm,GPI_LS_DISPENSER_25_8,true,true,DEBUG_LOG_CATEGORY__Warning,7,0,0,false,EVENT_TYPE__DispenserLowLevel}, +{100,TemperatureAlarm,TEMP_SENSE_ANALOG_MIXCHIP_TEMP,250,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__GeneralInternalOverTemperature}, +{100,TemperatureAlarm,TEMP_SENSE_AN_ENCLOSURETEMP1,80,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__GeneralInternalOverTemperature}, +{100,TemperatureAlarm,TEMP_SENSE_AN_ENCLOSURETEMP2,80,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__GeneralInternalOverTemperature}, +{100,TemperatureAlarm,TEMP_SENSE_AN_ENCLOSURETEMP3,250,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__DyeingHeadOverTemperature}, +{100,TemperatureAlarm,TEMP_SENSE_ANALOG_DYEINGH_TEMP1,250,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__DyeingHeadOverTemperature}, +{100,TemperatureAlarm,TEMP_SENSE_ANALOG_DYEINGH_TEMP2,250,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__DyeingHeadOverTemperature}, +{100,TemperatureAlarm,TEMP_SENSE_ANALOG_DYEINGH_TEMP3,250,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__DyeingHeadOverTemperature}, +{100,TemperatureAlarm,TEMP_SENSE_ANALOG_DYEINGH_TEMP4,250,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__DyeingHeadOverTemperature}, +{100,TemperatureAlarm,TEMP_SENSE_ANALOG_DYEINGH_TEMP5,250,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__DyeingHeadOverTemperature}, +{100,TemperatureAlarm,TEMP_SENSE_ANALOG_DRYER_TEMP1,250,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__DryerOverTemperature}, +{100,TemperatureAlarm,TEMP_SENSE_ANALOG_DRYER_TEMP1,250,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__DryerOverTemperature}, +{100,TemperatureAlarm,TEMP_SENSE_ANALOG_DRYER_TEMP1,250,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__DryerOverTemperature}, +{100,PressureAlarm,1,7,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__DispenserPressure}, +{100,PressureAlarm,2,7,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__DispenserPressure}, +{100,PressureAlarm,3,7,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__DispenserPressure}, +{100,PressureAlarm,4,7,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__DispenserPressure}, +{100,PressureAlarm,5,7,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__DispenserPressure}, +{100,PressureAlarm,6,7,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__DispenserPressure}, +{100,PressureAlarm,7,7,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__DispenserPressure}, +{100,PressureAlarm,8,7,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,0,false,EVENT_TYPE__DispenserPressure}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING,x_STATUS_OCD,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorOverCurrent}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_RDRIVING,x_STATUS_OCD,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorOverCurrent}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_SCREW,x_STATUS_OCD,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorOverCurrent}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_WINDER,x_STATUS_OCD,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorOverCurrent}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_LDRIVING,x_STATUS_OCD,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorOverCurrent}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_1,x_STATUS_OCD,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorOverCurrent}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_2,x_STATUS_OCD,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorOverCurrent}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_3,x_STATUS_OCD,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorOverCurrent}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_4,x_STATUS_OCD,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorOverCurrent}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_5,x_STATUS_OCD,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorOverCurrent}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_6,x_STATUS_OCD,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorOverCurrent}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_7,x_STATUS_OCD,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorOverCurrent}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_8,x_STATUS_OCD,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorOverCurrent}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING,x_STATUS_TH_SD,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorOverTemperature}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_RDRIVING,x_STATUS_TH_SD,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorOverTemperature}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_SCREW,x_STATUS_TH_SD,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorOverTemperature}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_WINDER,x_STATUS_TH_SD,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorOverTemperature}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_LDRIVING,x_STATUS_TH_SD,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorOverTemperature}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_1,x_STATUS_TH_SD,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorOverTemperature}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_2,x_STATUS_TH_SD,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorOverTemperature}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_3,x_STATUS_TH_SD,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorOverTemperature}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_4,x_STATUS_TH_SD,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorOverTemperature}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_5,x_STATUS_TH_SD,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorOverTemperature}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_6,x_STATUS_TH_SD,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorOverTemperature}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_7,x_STATUS_TH_SD,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorOverTemperature}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_8,x_STATUS_TH_SD,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorOverTemperature}, +}; +//read dispensers limit switches. 25 - send warning. up - stop job and send alarm +//Cone missing +//Dyeing head over temperature +//mixer over temperature +//dryer over temperature +//heaters failure +//dispenser pressure +//valve OCD +//Motor Status +//machine cover open void AlarmHandlingInit(void) { Error_Block eb; @@ -132,6 +234,7 @@ uint32_t AlarmHandlingConsequentActions(EventType EventId, DebugLogCategory Seve break; case DEBUG_LOG_CATEGORY__Critical: JobEndReason = JOB_OTHER_ALARM; + watchdogCriticalAlarm = true; EndState(NULL,event_type__descriptor.name[EventId]); //stop job //turn machine off @@ -145,11 +248,165 @@ uint32_t AlarmHandlingConsequentActions(EventType EventId, DebugLogCategory Seve } return OK; } +bool AlarmHandlingActive = false; +uint32_t AlarmHandlingControlId = 0xFF; +uint32_t AlarmHandlingTick = 0; + +uint32_t AlarmHandling_ControlTrigger(uint32_t IfIndex, uint32_t ReadValue) +{ + AlarmHandlingMessageStruc Message; + + //send message to the Millisec task + Message.messageId = AlarmHandlingTrigger; + Message.msglen = sizeof(AlarmHandlingMessageStruc); + AlarmHandlingTick +=10; + Message.tick = AlarmHandlingTick; + if (AlarmHandlingMsgQ != NULL) + Mailbox_post(AlarmHandlingMsgQ , &Message, BIOS_NO_WAIT); + + + return OK; +} +uint32_t AlarmHandlingEmptyCBFunction(uint32_t IfIndex, uint32_t ReadValue) +{ + return OK; +} + +uint32_t AlarmHandlingStart(void) +{ + + if ( AlarmHandlingActive == false) + { + AlarmHandlingActive = true; + AlarmHandlingControlId = AddControlCallback(AlarmHandling_ControlTrigger,eTenMillisecond,AlarmHandlingEmptyCBFunction,0,0,0); + } + return OK; +} +uint32_t AlarmHandlingStop(void) +{ + if ( AlarmHandlingActive == true) + { + AlarmHandlingActive = false; + if (AlarmHandlingControlId != 0xFF) + RemoveControlCallback(AlarmHandlingControlId,AlarmHandling_ControlTrigger); + + AlarmHandlingControlId = 0xFF; + } + return OK; +} uint32_t AlarmHandlingLoop(uint32_t tick) { + int Alarm_i; + uint32_t value; + bool Status = false; + for (Alarm_i = 0;Alarm_i < MAX_SYSTEM_ALARMS;Alarm_i++) + { + if (AlarmItem[Alarm_i].Frequency%tick == 0) + { + if (AlarmItem[Alarm_i].Predecessor) + if (AlarmItem[AlarmItem[Alarm_i].Predecessor].Status == true) //higher hierarchy alarm is on + continue; + switch (AlarmItem[Alarm_i].AlarmSource) + { + case TemperatureAlarm: + value = TemperatureSensorRead(AlarmItem[Alarm_i].DeviceId); + if (AlarmItem[Alarm_i].AlarmDirection == true) + { + if (value >= AlarmItem[Alarm_i].AlarmValue) + { + Status = true; + } + } + else + { + if (value <= AlarmItem[Alarm_i].AlarmValue) + { + Status = true; + } + } + break; + case LimitSwitchAlarm: + value = FPGA_Read_limit_Switches(AlarmItem[Alarm_i].DeviceId); + if (value == AlarmItem[Alarm_i].AlarmValue) + { + Status = true; + } + break; + case PressureAlarm: + value = GetDispenserPressure(AlarmItem[Alarm_i].DeviceId)/1000000; + if (AlarmItem[Alarm_i].AlarmDirection == true) + { + if (value >= AlarmItem[Alarm_i].AlarmValue) + { + Status = true; + } + } + else + { + if (value <= AlarmItem[Alarm_i].AlarmValue) + { + Status = true; + } + } + break; + case CurrentAlarm: + break; + case MotorAlarm: + value = MotorGetStatus(AlarmItem[Alarm_i].DeviceId); + if (value && AlarmItem[Alarm_i].AlarmValue) // + { + Status = true; + } + break; + default: + break; + } //switch + if (AlarmItem[Alarm_i].DebounceValue > 0) //handle debouncing + { + if (Status == true) //increase counter + { + AlarmItem[Alarm_i].DebounceCounter++; + if (AlarmItem[Alarm_i].DebounceCounter < AlarmItem[Alarm_i].DebounceValue) + { + Status = false; + } + else + { + AlarmItem[Alarm_i].DebounceCounter = AlarmItem[Alarm_i].DebounceValue; + } + } + else //status == false - decrease counter + { + AlarmItem[Alarm_i].DebounceCounter--; + if (AlarmItem[Alarm_i].DebounceCounter > 0) + { + Status = true; + } + else + { + AlarmItem[Alarm_i].DebounceCounter = 0; + } + } + } + if (Status != AlarmItem[Alarm_i].Status) //change in alarm Status + { + if (Status == true) // alarm on + { + AlarmItem[Alarm_i].Status = true; + AlarmHandlingConsequentActions(AlarmItem[Alarm_i].EventType, AlarmItem[Alarm_i].Severity); + // report the alarm! + } + else // alarm off + { + AlarmItem[Alarm_i].Status = false; + AlarmHandlingConsequentActions(AlarmItem[Alarm_i].EventType, DEBUG_LOG_CATEGORY__Info); + // report the alarm! + } + } + } + } //read dispensers limit switches. 25 - send warning. up - stop job and send alarm - //Cone missing //Dyeing head over temperature //mixer over temperature diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.h b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.h index d14d2c717..5a3aa66af 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.h +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.h @@ -8,5 +8,9 @@ #ifndef MODULES_ALARMHANDLING_ALARMHANDLING_H_ #define MODULES_ALARMHANDLING_ALARMHANDLING_H_ +uint32_t AlarmHandling_ControlTrigger(uint32_t IfIndex, uint32_t ReadValue); +uint32_t AlarmHandlingEmptyCBFunction(uint32_t IfIndex, uint32_t ReadValue); +uint32_t AlarmHandlingStart(void); +uint32_t AlarmHandlingStop(void); #endif /* MODULES_ALARMHANDLING_ALARMHANDLING_H_ */ 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_ */ diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index 1ca1e5f84..5874235a6 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -15,8 +15,8 @@ #include #include "drivers/Motors/Motor.h" -#include "drivers/SSI_Comm/SSI_Comm.h" #include "drivers/Heater/TemperatureSensor.h" +#include "drivers/SSI_Comm/Dancer/Dancer.h" #include "drivers/FPGA/FPGA_SPI_Comm.h" #include "drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h" #include "drivers/FPGA/FPGA.h" @@ -292,7 +292,7 @@ void SendDiagnostics(void) { MessageContainer responseContainer; StartDiagnosticsResponse response = START_DIAGNOSTICS_RESPONSE__INIT; - int i; + //int i; if (DiagnosticsActive == false) return; @@ -461,6 +461,7 @@ void SendDiagnostics(void) } } uint32_t DiagnosticsControlId = 0xff; +uint32_t Diagnostics10MSControlId = 0xff; bool DiagnosticRequestAccepted = false; uint32_t DiagnosticsEmptyCBFunction(uint32_t IfIndex, uint32_t ReadValue) { @@ -475,7 +476,7 @@ uint32_t DiagnosticsStart(void) { DiagnosticsActive = true; DiagnosticsControlId = AddControlCallback(Diagnostics_ControlTrigger,DiagnosticLimit,DiagnosticsEmptyCBFunction,0,0,0); - DiagnosticsControlId = AddControlCallback(Diagnostics_TenMiliControlTrigger,DiagnosticFastLimit,DiagnosticsEmptyCBFunction,0,0,0); + Diagnostics10MSControlId = AddControlCallback(Diagnostics_TenMiliControlTrigger,DiagnosticFastLimit,DiagnosticsEmptyCBFunction,0,0,0); } } return OK; @@ -487,7 +488,12 @@ uint32_t DiagnosticsStop(void) DiagnosticsActive = false; if (DiagnosticsControlId != 0xFF) RemoveControlCallback(DiagnosticsControlId,Diagnostics_ControlTrigger); + if (Diagnostics10MSControlId != 0xFF) + RemoveControlCallback(Diagnostics10MSControlId,Diagnostics_TenMiliControlTrigger); + DiagnosticsControlId = 0xFF; + Diagnostics10MSControlId = 0xFF; + } return OK; } diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index 9600b9310..dc9d89766 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -10,6 +10,7 @@ #include "thread/thread.h" #include "ids/ids.h" #include "control/control.h" +#include "AlarmHandling/AlarmHandling.h" #include "heaters/heaters_ex.h" #include "StateMachines/Printing/PrintingSTM.h" @@ -106,6 +107,7 @@ uint32_t HWConfigurationFunc(MessageContainer* requestContainer) } ControlStart(); + AlarmHandlingStart(); //ThreadInitialTestStub(request); -- cgit v1.3.1 From da8c561c85c9ee296cb18796e5db95ca759d1063 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Sun, 12 Aug 2018 18:22:48 +0300 Subject: fix dryer heaters --- Software/Embedded_SW/Embedded/Drivers/Heater/Heater.c | 2 +- Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c | 5 +++-- Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c | 4 ++++ .../Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c | 1 + Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c | 6 +++--- 5 files changed, 12 insertions(+), 6 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Drivers/Heater/Heater.c b/Software/Embedded_SW/Embedded/Drivers/Heater/Heater.c index 99190e02a..5f5f04063 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Heater/Heater.c +++ b/Software/Embedded_SW/Embedded/Drivers/Heater/Heater.c @@ -39,7 +39,7 @@ static GPIOIntPortMap portMap[MAX_HEATERS_NUM] = { {DRYER_SSR2_CTRL, false}, // HARDWARE_PID_CONTROL_TYPE__DryerAirTemperature {DRYER_SSR1_CTRL, false}, // HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain - {DRYER_SSR3_CTRL, false}, // HARDWARE_PID_CONTROL_TYPE__DryerHeaterSecondary + {DRYER_SSR2_CTRL, false}, // HARDWARE_PID_CONTROL_TYPE__DryerHeaterSecondary {DYEINGH_SSR8_CTRL, false}, // HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ1 - Head Heater #1 - rightmost {DYEINGH_SSR7_CTRL, false}, // HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ2 - Head Heaters #2 #3 #4 {DYEINGH_SSR6_CTRL, false}, // HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ3 - Head Heaters #5 #6 #7 #8 diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index 559db0e79..25f826d92 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -179,6 +179,7 @@ int32_t MillisecReadFromTempSensor(uint32_t TempSensorId, MSecFptr Callback) PT100Activity++; //get response PT100Activity++; //read request PT100Data[TempSensorId].Callback = Callback; + PT100Data[TempSensorId].WaitForData = true; PT100Data[TempSensorId].DataRequired = true; PT100Data[TempSensorId].Active = true; @@ -343,7 +344,7 @@ uint32_t MillisecLoop(uint32_t tick) { TemperatureSendSensorDummyClk((TEMPERATURE_SENSOR_ID_ENUM)Sensor_i); PT100Data[Sensor_i].SyncRequired = false; - if (PT100Data[Sensor_i].DataRequired == true) + /*if (PT100Data[Sensor_i].DataRequired == true) { PT100Data[Sensor_i].WaitForData = true; // mark the motor for data request next round } @@ -351,7 +352,7 @@ uint32_t MillisecLoop(uint32_t tick) { if (PT100Data[Sensor_i].Callback) PT100Data[Sensor_i].Callback(Sensor_i,0); // call the callback to report execution - } + }*/ PT100Activity--; } diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index 1ca1e5f84..56e2d65bb 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -229,6 +229,10 @@ void Diagnostic100msecCollection(void) DiagnosticLoadTemperature(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ5, TemperatureSensorRead(TEMP_SENSE_ANALOG_DYEINGH_TEMP5)); DiagnosticLoadTemperature(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ6, TemperatureSensorRead(TEMP_SENSE_ANALOG_MIXCHIP_TEMP)); #ifndef DEMO_TEMPERATURE +//#define DRYER_AIR_PT100 TEMP_SENSE_ANALOG_DRYER_TEMP2 +//#define DRYER_MAIN_PT100 TEMP_SENSE_ANALOG_DRYER_TEMP1 +//#define DRYER_SECONDARY_PT100 TEMP_SENSE_ANALOG_DRYER_TEMP3 + DiagnosticLoadTemperature(HARDWARE_PID_CONTROL_TYPE__DryerAirTemperature, TemperatureSensorRead(TEMP_SENSE_ANALOG_DRYER_TEMP1)); DiagnosticLoadTemperature(HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain, TemperatureSensorRead(TEMP_SENSE_ANALOG_DRYER_TEMP2)); DiagnosticLoadTemperature(HARDWARE_PID_CONTROL_TYPE__DryerHeaterSecondary, TemperatureSensorRead(TEMP_SENSE_ANALOG_DRYER_TEMP3)); diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c index 4e573cb82..2d73379d6 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c @@ -456,5 +456,6 @@ uint32_t SetComponentValueRequestRequestFunc(MessageContainer* requestContainer) //free(requestContainer); set_component_value_request__free_unpacked(request,NULL); + return OK; } diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index 01a08125a..861c77e3b 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -46,9 +46,9 @@ uint32_t ControlIdtoHeaterId [MAX_HEATERS_NUM] = {0xFF,0xFF,0xFF,0xFF,0xFF,0x uint32_t MainDryerHeaterMaxTempControl = 0xFF; uint32_t SecondDryerHeaterMaxTempControl = 0xFF; -#define DRYER_AIR_PT100 TEMP_SENSE_ANALOG_DRYER_TEMP3 -#define DRYER_MAIN_PT100 TEMP_SENSE_ANALOG_DRYER_TEMP1 -#define DRYER_SECONDARY_PT100 TEMP_SENSE_ANALOG_DRYER_TEMP2 +#define DRYER_AIR_PT100 TEMP_SENSE_ANALOG_DRYER_TEMP1 +#define DRYER_MAIN_PT100 TEMP_SENSE_ANALOG_DRYER_TEMP2 +#define DRYER_SECONDARY_PT100 TEMP_SENSE_ANALOG_DRYER_TEMP3 uint32_t HeaterId2PT100Id[MAX_HEATERS_NUM] = {DRYER_AIR_PT100,DRYER_MAIN_PT100,DRYER_SECONDARY_PT100,TEMP_SENSE_ANALOG_DYEINGH_TEMP1,TEMP_SENSE_ANALOG_DYEINGH_TEMP2,TEMP_SENSE_ANALOG_DYEINGH_TEMP3,TEMP_SENSE_ANALOG_DYEINGH_TEMP4,TEMP_SENSE_ANALOG_DYEINGH_TEMP5,TEMP_SENSE_ANALOG_MIXCHIP_TEMP,TEMP_SENSE_AN_ENCLOSURETEMP3}; uint32_t DryerInternalPT100Id = DRYER_AIR_PT100; -- cgit v1.3.1 From 6707b4e66f619eb7906fe160bfe206c7266066ba Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Mon, 13 Aug 2018 09:43:44 +0300 Subject: turn off/on AC heaters on max temp together --- .../Embedded/Modules/Heaters/Heaters_print.c | 37 +++++++++++++++++----- 1 file changed, 29 insertions(+), 8 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index 861c77e3b..2450b32e2 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -348,9 +348,18 @@ bool HeaterGetOverTemperatureState(uint8_t HeaterId) if (HeaterId > MAX_HEATERS_NUM) return false; return HeaterMaxTempFlag[HeaterId]; } +uint32_t MainPT100Read = 0,SecondaryPT100Read = 0; +#ifndef max + #define max(a,b) ((a) > (b) ? (a) : (b)) +#endif +#ifndef min + #define min(a,b) ((a) < (b) ? (a) : (b)) +#endif uint32_t HeaterMaxTempCBFunction(uint32_t IfIndex, uint32_t readValue) { int index=MAX_HEATERS_NUM; + uint32_t MaxreadValue = max (MainPT100Read,SecondaryPT100Read); + uint32_t MinreadValue = min (MainPT100Read,SecondaryPT100Read); /*char str[100]; uint8_t len = 0;*/ if (IfIndex>>8 != IfTypeHeaters) @@ -364,26 +373,38 @@ uint32_t HeaterMaxTempCBFunction(uint32_t IfIndex, uint32_t readValue) LOG_ERROR (IfIndex, "Wrong Interface "); return 0xFFFFFFFF; } - if ((readValue/100) >= HeaterControl[index].sensormaxvalue) + if (index == HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain) + { + MainPT100Read = readValue; + } + if (index == HARDWARE_PID_CONTROL_TYPE__DryerHeaterSecondary) + { + SecondaryPT100Read = readValue; + } + if ((MaxreadValue/100) >= HeaterControl[index].sensormaxvalue) { if (HeaterMaxTempFlag[index] == false) { - LOG_ERROR (readValue, "Heater Over the max temperature, turned off"); + LOG_ERROR (MaxreadValue/100, "Heater Over the max temperature, turned off"); } - DeActivateHeater(index); - HeaterMaxTempFlag[index] = true; + DeActivateHeater(HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain); + HeaterMaxTempFlag[HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain] = true; + DeActivateHeater(HARDWARE_PID_CONTROL_TYPE__DryerHeaterSecondary); + HeaterMaxTempFlag[HARDWARE_PID_CONTROL_TYPE__DryerHeaterSecondary] = true; return OK; } - if ((readValue/100) <= (HeaterControl[index].sensormaxvalue-HeaterControl[index].sensorminvalue)) + if ((MinreadValue/100) <= (HeaterControl[index].sensormaxvalue-HeaterControl[index].sensorminvalue)) { if (HeaterControl[index].sensorminvalue > 0) { if (HeaterMaxTempFlag[index] == true) { - ActivateHeater(index); - LOG_ERROR ((readValue/100), "Heater Cooled Off max temperature, turned on"); + ActivateHeater(HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain); + ActivateHeater(HARDWARE_PID_CONTROL_TYPE__DryerHeaterSecondary); + LOG_ERROR ((MinreadValue/100), "Heater Cooled Off max temperature, turned on"); } - HeaterMaxTempFlag[index] = false; + HeaterMaxTempFlag[HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain] = false; + HeaterMaxTempFlag[HARDWARE_PID_CONTROL_TYPE__DryerHeaterSecondary] = false; } return OK; } -- cgit v1.3.1 From acde45615085df2a8ca4286f55f42ea16aee1943 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Mon, 13 Aug 2018 09:46:03 +0300 Subject: pressure in bars --- Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c | 2 +- Software/Embedded_SW/Embedded/Modules/IDS/IDS_init.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index 56e2d65bb..a2031a2e2 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -256,7 +256,7 @@ void Diagnostic100msecCollection(void) for (i=0;i 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') 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 Date: Mon, 13 Aug 2018 11:46:39 +0300 Subject: alarm handling event --- .../Communication/PMR/Common/MessageType.pb-c.c | 74 +++++++++-------- .../Communication/PMR/Common/MessageType.pb-c.h | 4 + .../Diagnostics/StartDiagnosticsResponse.pb-c.c | 19 +---- .../Diagnostics/StartDiagnosticsResponse.pb-c.h | 5 +- .../StartEventsNotificationRequest.pb-c.c | 72 +++++++++++++++++ .../StartEventsNotificationRequest.pb-c.h | 70 ++++++++++++++++ .../StartEventsNotificationResponse.pb-c.c | 92 ++++++++++++++++++++++ .../StartEventsNotificationResponse.pb-c.h | 73 +++++++++++++++++ .../StopEventsNotificationRequest.pb-c.c | 72 +++++++++++++++++ .../StopEventsNotificationRequest.pb-c.h | 70 ++++++++++++++++ .../StopEventsNotificationResponse.pb-c.c | 72 +++++++++++++++++ .../StopEventsNotificationResponse.pb-c.h | 70 ++++++++++++++++ .../Embedded/Modules/Diagnostics/Diagnostics.c | 1 - 13 files changed, 640 insertions(+), 54 deletions(-) create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartEventsNotificationRequest.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartEventsNotificationRequest.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartEventsNotificationResponse.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartEventsNotificationResponse.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StopEventsNotificationRequest.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StopEventsNotificationRequest.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StopEventsNotificationResponse.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StopEventsNotificationResponse.pb-c.h (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.c index 11f08cffe..36339d7ff 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.c @@ -7,7 +7,7 @@ #endif #include "MessageType.pb-c.h" -static const ProtobufCEnumValue message_type__enum_values_by_number[165] = +static const ProtobufCEnumValue message_type__enum_values_by_number[169] = { { "None", "MESSAGE_TYPE__None", 0 }, { "ErrorResponse", "MESSAGE_TYPE__ErrorResponse", 1 }, @@ -146,6 +146,10 @@ static const ProtobufCEnumValue message_type__enum_values_by_number[165] = { "ResolveEventResponse", "MESSAGE_TYPE__ResolveEventResponse", 2027 }, { "StopDiagnosticsRequest", "MESSAGE_TYPE__StopDiagnosticsRequest", 2028 }, { "StopDiagnosticsResponse", "MESSAGE_TYPE__StopDiagnosticsResponse", 2029 }, + { "StartEventsNotificationRequest", "MESSAGE_TYPE__StartEventsNotificationRequest", 2030 }, + { "StartEventsNotificationResponse", "MESSAGE_TYPE__StartEventsNotificationResponse", 2031 }, + { "StopEventsNotificationRequest", "MESSAGE_TYPE__StopEventsNotificationRequest", 2032 }, + { "StopEventsNotificationResponse", "MESSAGE_TYPE__StopEventsNotificationResponse", 2033 }, { "JobRequest", "MESSAGE_TYPE__JobRequest", 3000 }, { "JobResponse", "MESSAGE_TYPE__JobResponse", 3001 }, { "AbortJobRequest", "MESSAGE_TYPE__AbortJobRequest", 3002 }, @@ -176,20 +180,20 @@ static const ProtobufCEnumValue message_type__enum_values_by_number[165] = { "KillProcessResponse", "MESSAGE_TYPE__KillProcessResponse", 7007 }, }; static const ProtobufCIntRange message_type__value_ranges[] = { -{0, 0},{3, 2},{1000, 98},{2000, 107},{3000, 137},{4000, 143},{5000, 147},{6000, 151},{7000, 157},{0, 165} +{0, 0},{3, 2},{1000, 98},{2000, 107},{3000, 141},{4000, 147},{5000, 151},{6000, 155},{7000, 161},{0, 169} }; -static const ProtobufCEnumValueIndex message_type__enum_values_by_name[165] = +static const ProtobufCEnumValueIndex message_type__enum_values_by_name[169] = { - { "AbortJobRequest", 139 }, - { "AbortJobResponse", 140 }, + { "AbortJobRequest", 143 }, + { "AbortJobResponse", 144 }, { "CalculateRequest", 2 }, { "CalculateResponse", 3 }, - { "ConnectRequest", 153 }, - { "ConnectResponse", 154 }, + { "ConnectRequest", 157 }, + { "ConnectResponse", 158 }, { "DirectSynchronizationRequest", 103 }, { "DirectSynchronizationResponse", 104 }, - { "DisconnectRequest", 155 }, - { "DisconnectResponse", 156 }, + { "DisconnectRequest", 159 }, + { "DisconnectResponse", 160 }, { "DispenserAbortHomingRequest", 117 }, { "DispenserAbortHomingResponse", 118 }, { "DispenserAbortJoggingRequest", 123 }, @@ -199,23 +203,23 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[165] = { "DispenserJoggingRequest", 121 }, { "DispenserJoggingResponse", 122 }, { "ErrorResponse", 1 }, - { "ExecuteProcessRequest", 161 }, - { "ExecuteProcessResponse", 162 }, + { "ExecuteProcessRequest", 165 }, + { "ExecuteProcessResponse", 166 }, { "ExternalBridgeLoginRequest", 99 }, { "ExternalBridgeLoginResponse", 100 }, { "ExternalBridgeLogoutRequest", 101 }, { "ExternalBridgeLogoutResponse", 102 }, { "ExternalBridgeUdpDiscoveryPacket", 98 }, - { "FileChunkUploadRequest", 159 }, - { "FileChunkUploadResponse", 160 }, - { "FileUploadRequest", 157 }, - { "FileUploadResponse", 158 }, - { "JobRequest", 137 }, - { "JobResponse", 138 }, - { "KeepAliveRequest", 151 }, - { "KeepAliveResponse", 152 }, - { "KillProcessRequest", 163 }, - { "KillProcessResponse", 164 }, + { "FileChunkUploadRequest", 163 }, + { "FileChunkUploadResponse", 164 }, + { "FileUploadRequest", 161 }, + { "FileUploadResponse", 162 }, + { "JobRequest", 141 }, + { "JobResponse", 142 }, + { "KeepAliveRequest", 155 }, + { "KeepAliveResponse", 156 }, + { "KillProcessRequest", 167 }, + { "KillProcessResponse", 168 }, { "MotorAbortHomingRequest", 109 }, { "MotorAbortHomingResponse", 110 }, { "MotorAbortJoggingRequest", 115 }, @@ -235,14 +239,18 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[165] = { "SetComponentValueResponse", 132 }, { "SetDigitalOutRequest", 125 }, { "SetDigitalOutResponse", 126 }, - { "StartDebugLogRequest", 143 }, - { "StartDebugLogResponse", 144 }, + { "StartDebugLogRequest", 147 }, + { "StartDebugLogResponse", 148 }, { "StartDiagnosticsRequest", 107 }, { "StartDiagnosticsResponse", 108 }, - { "StopDebugLogRequest", 145 }, - { "StopDebugLogResponse", 146 }, + { "StartEventsNotificationRequest", 137 }, + { "StartEventsNotificationResponse", 138 }, + { "StopDebugLogRequest", 149 }, + { "StopDebugLogResponse", 150 }, { "StopDiagnosticsRequest", 135 }, { "StopDiagnosticsResponse", 136 }, + { "StopEventsNotificationRequest", 139 }, + { "StopEventsNotificationResponse", 140 }, { "StubCartridgeReadRequest", 6 }, { "StubCartridgeReadResponse", 7 }, { "StubCartridgeWriteRequest", 8 }, @@ -335,16 +343,16 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[165] = { "StubTivaWriteRegResponse", 79 }, { "StubValveRequest", 30 }, { "StubValveResponse", 31 }, - { "SystemResetRequest", 149 }, - { "SystemResetResponse", 150 }, + { "SystemResetRequest", 153 }, + { "SystemResetResponse", 154 }, { "ThreadAbortJoggingRequest", 129 }, { "ThreadAbortJoggingResponse", 130 }, { "ThreadJoggingRequest", 127 }, { "ThreadJoggingResponse", 128 }, - { "UploadHardwareConfigurationRequest", 147 }, - { "UploadHardwareConfigurationResponse", 148 }, - { "UploadProcessParametersRequest", 141 }, - { "UploadProcessParametersResponse", 142 }, + { "UploadHardwareConfigurationRequest", 151 }, + { "UploadHardwareConfigurationResponse", 152 }, + { "UploadProcessParametersRequest", 145 }, + { "UploadProcessParametersResponse", 146 }, }; const ProtobufCEnumDescriptor message_type__descriptor = { @@ -353,9 +361,9 @@ const ProtobufCEnumDescriptor message_type__descriptor = "MessageType", "MessageType", "", - 165, + 169, message_type__enum_values_by_number, - 165, + 169, message_type__enum_values_by_name, 9, message_type__value_ranges, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.h index b4f7ec76a..bc5f4286e 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.h @@ -157,6 +157,10 @@ typedef enum _MessageType { MESSAGE_TYPE__ResolveEventResponse = 2027, MESSAGE_TYPE__StopDiagnosticsRequest = 2028, MESSAGE_TYPE__StopDiagnosticsResponse = 2029, + MESSAGE_TYPE__StartEventsNotificationRequest = 2030, + MESSAGE_TYPE__StartEventsNotificationResponse = 2031, + MESSAGE_TYPE__StopEventsNotificationRequest = 2032, + MESSAGE_TYPE__StopEventsNotificationResponse = 2033, MESSAGE_TYPE__JobRequest = 3000, MESSAGE_TYPE__JobResponse = 3001, MESSAGE_TYPE__AbortJobRequest = 3002, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartDiagnosticsResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartDiagnosticsResponse.pb-c.c index a337e084d..9da91e211 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartDiagnosticsResponse.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartDiagnosticsResponse.pb-c.c @@ -52,7 +52,7 @@ void start_diagnostics_response__free_unpacked assert(message->base.descriptor == &start_diagnostics_response__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -static const ProtobufCFieldDescriptor start_diagnostics_response__field_descriptors[4] = +static const ProtobufCFieldDescriptor start_diagnostics_response__field_descriptors[3] = { { "Monitors", @@ -90,29 +90,16 @@ static const ProtobufCFieldDescriptor start_diagnostics_response__field_descript 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, - { - "Events", - 4, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_MESSAGE, - offsetof(StartDiagnosticsResponse, n_events), - offsetof(StartDiagnosticsResponse, events), - &event__descriptor, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, }; static const unsigned start_diagnostics_response__field_indices_by_name[] = { 2, /* field[2] = ComponentsStates */ 1, /* field[1] = DigitalPins */ - 3, /* field[3] = Events */ 0, /* field[0] = Monitors */ }; static const ProtobufCIntRange start_diagnostics_response__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 4 } + { 0, 3 } }; const ProtobufCMessageDescriptor start_diagnostics_response__descriptor = { @@ -122,7 +109,7 @@ const ProtobufCMessageDescriptor start_diagnostics_response__descriptor = "StartDiagnosticsResponse", "", sizeof(StartDiagnosticsResponse), - 4, + 3, start_diagnostics_response__field_descriptors, start_diagnostics_response__field_indices_by_name, 1, start_diagnostics_response__number_ranges, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartDiagnosticsResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartDiagnosticsResponse.pb-c.h index ca559d62b..cd1afd411 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartDiagnosticsResponse.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartDiagnosticsResponse.pb-c.h @@ -17,7 +17,6 @@ PROTOBUF_C__BEGIN_DECLS #include "DigitalPin.pb-c.h" #include "ValueComponentState.pb-c.h" #include "DiagnosticsMonitors.pb-c.h" -#include "Event.pb-c.h" typedef struct _StartDiagnosticsResponse StartDiagnosticsResponse; @@ -35,12 +34,10 @@ struct _StartDiagnosticsResponse DigitalPin **digitalpins; size_t n_componentsstates; ValueComponentState **componentsstates; - size_t n_events; - Event **events; }; #define START_DIAGNOSTICS_RESPONSE__INIT \ { PROTOBUF_C_MESSAGE_INIT (&start_diagnostics_response__descriptor) \ - , NULL, 0,NULL, 0,NULL, 0,NULL } + , NULL, 0,NULL, 0,NULL } /* StartDiagnosticsResponse methods */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartEventsNotificationRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartEventsNotificationRequest.pb-c.c new file mode 100644 index 000000000..40192e133 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartEventsNotificationRequest.pb-c.c @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StartEventsNotificationRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StartEventsNotificationRequest.pb-c.h" +void start_events_notification_request__init + (StartEventsNotificationRequest *message) +{ + static const StartEventsNotificationRequest init_value = START_EVENTS_NOTIFICATION_REQUEST__INIT; + *message = init_value; +} +size_t start_events_notification_request__get_packed_size + (const StartEventsNotificationRequest *message) +{ + assert(message->base.descriptor == &start_events_notification_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t start_events_notification_request__pack + (const StartEventsNotificationRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &start_events_notification_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t start_events_notification_request__pack_to_buffer + (const StartEventsNotificationRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &start_events_notification_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StartEventsNotificationRequest * + start_events_notification_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StartEventsNotificationRequest *) + protobuf_c_message_unpack (&start_events_notification_request__descriptor, + allocator, len, data); +} +void start_events_notification_request__free_unpacked + (StartEventsNotificationRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &start_events_notification_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +#define start_events_notification_request__field_descriptors NULL +#define start_events_notification_request__field_indices_by_name NULL +#define start_events_notification_request__number_ranges NULL +const ProtobufCMessageDescriptor start_events_notification_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StartEventsNotificationRequest", + "StartEventsNotificationRequest", + "StartEventsNotificationRequest", + "", + sizeof(StartEventsNotificationRequest), + 0, + start_events_notification_request__field_descriptors, + start_events_notification_request__field_indices_by_name, + 0, start_events_notification_request__number_ranges, + (ProtobufCMessageInit) start_events_notification_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartEventsNotificationRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartEventsNotificationRequest.pb-c.h new file mode 100644 index 000000000..8db260d72 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartEventsNotificationRequest.pb-c.h @@ -0,0 +1,70 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StartEventsNotificationRequest.proto */ + +#ifndef PROTOBUF_C_StartEventsNotificationRequest_2eproto__INCLUDED +#define PROTOBUF_C_StartEventsNotificationRequest_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StartEventsNotificationRequest StartEventsNotificationRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StartEventsNotificationRequest +{ + ProtobufCMessage base; +}; +#define START_EVENTS_NOTIFICATION_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&start_events_notification_request__descriptor) \ + } + + +/* StartEventsNotificationRequest methods */ +void start_events_notification_request__init + (StartEventsNotificationRequest *message); +size_t start_events_notification_request__get_packed_size + (const StartEventsNotificationRequest *message); +size_t start_events_notification_request__pack + (const StartEventsNotificationRequest *message, + uint8_t *out); +size_t start_events_notification_request__pack_to_buffer + (const StartEventsNotificationRequest *message, + ProtobufCBuffer *buffer); +StartEventsNotificationRequest * + start_events_notification_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void start_events_notification_request__free_unpacked + (StartEventsNotificationRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StartEventsNotificationRequest_Closure) + (const StartEventsNotificationRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor start_events_notification_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StartEventsNotificationRequest_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartEventsNotificationResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartEventsNotificationResponse.pb-c.c new file mode 100644 index 000000000..5db916a19 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartEventsNotificationResponse.pb-c.c @@ -0,0 +1,92 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StartEventsNotificationResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StartEventsNotificationResponse.pb-c.h" +void start_events_notification_response__init + (StartEventsNotificationResponse *message) +{ + static const StartEventsNotificationResponse init_value = START_EVENTS_NOTIFICATION_RESPONSE__INIT; + *message = init_value; +} +size_t start_events_notification_response__get_packed_size + (const StartEventsNotificationResponse *message) +{ + assert(message->base.descriptor == &start_events_notification_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t start_events_notification_response__pack + (const StartEventsNotificationResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &start_events_notification_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t start_events_notification_response__pack_to_buffer + (const StartEventsNotificationResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &start_events_notification_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StartEventsNotificationResponse * + start_events_notification_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StartEventsNotificationResponse *) + protobuf_c_message_unpack (&start_events_notification_response__descriptor, + allocator, len, data); +} +void start_events_notification_response__free_unpacked + (StartEventsNotificationResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &start_events_notification_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor start_events_notification_response__field_descriptors[1] = +{ + { + "Events", + 1, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(StartEventsNotificationResponse, n_events), + offsetof(StartEventsNotificationResponse, events), + &event__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned start_events_notification_response__field_indices_by_name[] = { + 0, /* field[0] = Events */ +}; +static const ProtobufCIntRange start_events_notification_response__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor start_events_notification_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StartEventsNotificationResponse", + "StartEventsNotificationResponse", + "StartEventsNotificationResponse", + "", + sizeof(StartEventsNotificationResponse), + 1, + start_events_notification_response__field_descriptors, + start_events_notification_response__field_indices_by_name, + 1, start_events_notification_response__number_ranges, + (ProtobufCMessageInit) start_events_notification_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartEventsNotificationResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartEventsNotificationResponse.pb-c.h new file mode 100644 index 000000000..29c2bbc31 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartEventsNotificationResponse.pb-c.h @@ -0,0 +1,73 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StartEventsNotificationResponse.proto */ + +#ifndef PROTOBUF_C_StartEventsNotificationResponse_2eproto__INCLUDED +#define PROTOBUF_C_StartEventsNotificationResponse_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "Event.pb-c.h" + +typedef struct _StartEventsNotificationResponse StartEventsNotificationResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StartEventsNotificationResponse +{ + ProtobufCMessage base; + size_t n_events; + Event **events; +}; +#define START_EVENTS_NOTIFICATION_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&start_events_notification_response__descriptor) \ + , 0,NULL } + + +/* StartEventsNotificationResponse methods */ +void start_events_notification_response__init + (StartEventsNotificationResponse *message); +size_t start_events_notification_response__get_packed_size + (const StartEventsNotificationResponse *message); +size_t start_events_notification_response__pack + (const StartEventsNotificationResponse *message, + uint8_t *out); +size_t start_events_notification_response__pack_to_buffer + (const StartEventsNotificationResponse *message, + ProtobufCBuffer *buffer); +StartEventsNotificationResponse * + start_events_notification_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void start_events_notification_response__free_unpacked + (StartEventsNotificationResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StartEventsNotificationResponse_Closure) + (const StartEventsNotificationResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor start_events_notification_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StartEventsNotificationResponse_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StopEventsNotificationRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StopEventsNotificationRequest.pb-c.c new file mode 100644 index 000000000..6c3590e16 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StopEventsNotificationRequest.pb-c.c @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StopEventsNotificationRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StopEventsNotificationRequest.pb-c.h" +void stop_events_notification_request__init + (StopEventsNotificationRequest *message) +{ + static const StopEventsNotificationRequest init_value = STOP_EVENTS_NOTIFICATION_REQUEST__INIT; + *message = init_value; +} +size_t stop_events_notification_request__get_packed_size + (const StopEventsNotificationRequest *message) +{ + assert(message->base.descriptor == &stop_events_notification_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stop_events_notification_request__pack + (const StopEventsNotificationRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stop_events_notification_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stop_events_notification_request__pack_to_buffer + (const StopEventsNotificationRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stop_events_notification_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StopEventsNotificationRequest * + stop_events_notification_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StopEventsNotificationRequest *) + protobuf_c_message_unpack (&stop_events_notification_request__descriptor, + allocator, len, data); +} +void stop_events_notification_request__free_unpacked + (StopEventsNotificationRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stop_events_notification_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +#define stop_events_notification_request__field_descriptors NULL +#define stop_events_notification_request__field_indices_by_name NULL +#define stop_events_notification_request__number_ranges NULL +const ProtobufCMessageDescriptor stop_events_notification_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StopEventsNotificationRequest", + "StopEventsNotificationRequest", + "StopEventsNotificationRequest", + "", + sizeof(StopEventsNotificationRequest), + 0, + stop_events_notification_request__field_descriptors, + stop_events_notification_request__field_indices_by_name, + 0, stop_events_notification_request__number_ranges, + (ProtobufCMessageInit) stop_events_notification_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StopEventsNotificationRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StopEventsNotificationRequest.pb-c.h new file mode 100644 index 000000000..9fbcfedab --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StopEventsNotificationRequest.pb-c.h @@ -0,0 +1,70 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StopEventsNotificationRequest.proto */ + +#ifndef PROTOBUF_C_StopEventsNotificationRequest_2eproto__INCLUDED +#define PROTOBUF_C_StopEventsNotificationRequest_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StopEventsNotificationRequest StopEventsNotificationRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StopEventsNotificationRequest +{ + ProtobufCMessage base; +}; +#define STOP_EVENTS_NOTIFICATION_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stop_events_notification_request__descriptor) \ + } + + +/* StopEventsNotificationRequest methods */ +void stop_events_notification_request__init + (StopEventsNotificationRequest *message); +size_t stop_events_notification_request__get_packed_size + (const StopEventsNotificationRequest *message); +size_t stop_events_notification_request__pack + (const StopEventsNotificationRequest *message, + uint8_t *out); +size_t stop_events_notification_request__pack_to_buffer + (const StopEventsNotificationRequest *message, + ProtobufCBuffer *buffer); +StopEventsNotificationRequest * + stop_events_notification_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stop_events_notification_request__free_unpacked + (StopEventsNotificationRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StopEventsNotificationRequest_Closure) + (const StopEventsNotificationRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stop_events_notification_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StopEventsNotificationRequest_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StopEventsNotificationResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StopEventsNotificationResponse.pb-c.c new file mode 100644 index 000000000..fd9a62b69 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StopEventsNotificationResponse.pb-c.c @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StopEventsNotificationResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StopEventsNotificationResponse.pb-c.h" +void stop_events_notification_response__init + (StopEventsNotificationResponse *message) +{ + static const StopEventsNotificationResponse init_value = STOP_EVENTS_NOTIFICATION_RESPONSE__INIT; + *message = init_value; +} +size_t stop_events_notification_response__get_packed_size + (const StopEventsNotificationResponse *message) +{ + assert(message->base.descriptor == &stop_events_notification_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stop_events_notification_response__pack + (const StopEventsNotificationResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stop_events_notification_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stop_events_notification_response__pack_to_buffer + (const StopEventsNotificationResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stop_events_notification_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StopEventsNotificationResponse * + stop_events_notification_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StopEventsNotificationResponse *) + protobuf_c_message_unpack (&stop_events_notification_response__descriptor, + allocator, len, data); +} +void stop_events_notification_response__free_unpacked + (StopEventsNotificationResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stop_events_notification_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +#define stop_events_notification_response__field_descriptors NULL +#define stop_events_notification_response__field_indices_by_name NULL +#define stop_events_notification_response__number_ranges NULL +const ProtobufCMessageDescriptor stop_events_notification_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StopEventsNotificationResponse", + "StopEventsNotificationResponse", + "StopEventsNotificationResponse", + "", + sizeof(StopEventsNotificationResponse), + 0, + stop_events_notification_response__field_descriptors, + stop_events_notification_response__field_indices_by_name, + 0, stop_events_notification_response__number_ranges, + (ProtobufCMessageInit) stop_events_notification_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StopEventsNotificationResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StopEventsNotificationResponse.pb-c.h new file mode 100644 index 000000000..aca6ddf2a --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StopEventsNotificationResponse.pb-c.h @@ -0,0 +1,70 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StopEventsNotificationResponse.proto */ + +#ifndef PROTOBUF_C_StopEventsNotificationResponse_2eproto__INCLUDED +#define PROTOBUF_C_StopEventsNotificationResponse_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StopEventsNotificationResponse StopEventsNotificationResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StopEventsNotificationResponse +{ + ProtobufCMessage base; +}; +#define STOP_EVENTS_NOTIFICATION_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stop_events_notification_response__descriptor) \ + } + + +/* StopEventsNotificationResponse methods */ +void stop_events_notification_response__init + (StopEventsNotificationResponse *message); +size_t stop_events_notification_response__get_packed_size + (const StopEventsNotificationResponse *message); +size_t stop_events_notification_response__pack + (const StopEventsNotificationResponse *message, + uint8_t *out); +size_t stop_events_notification_response__pack_to_buffer + (const StopEventsNotificationResponse *message, + ProtobufCBuffer *buffer); +StopEventsNotificationResponse * + stop_events_notification_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stop_events_notification_response__free_unpacked + (StopEventsNotificationResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StopEventsNotificationResponse_Closure) + (const StopEventsNotificationResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stop_events_notification_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StopEventsNotificationResponse_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index ed6df7d80..477fc0732 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -431,7 +431,6 @@ void SendDiagnostics(void) response.monitors = &DiagnosticsMonitor; response.n_digitalpins = 0/**MAX_GPI*/; //response.digitalpins = DigitalPinArray; - response.n_events = 0; response.n_componentsstates = 0; /* if (blowervolatgedisplay == true) { -- cgit v1.3.1 From 34eb8e03fe22ee20f5020c8be2abbab7ac69117e Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Mon, 13 Aug 2018 12:10:25 +0300 Subject: improve heaters reset --- Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index 93f185c45..ff5af5aac 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -239,10 +239,10 @@ uint32_t HeaterCommandRequestMessage(int HeaterId, bool OnOff, int Temperature) } else if (OnOff == HEATER_OFF)//((HeaterState == HEATER_ON)&& (OnOff == HEATER_OFF)) //stop heating { - //turn off the heater - HeatersSingleHeaterEnd(HeaterId); //stop the control HeaterPIDConfig[HeaterId].m_SetParam = 0; + //turn off the heater + HeatersSingleHeaterEnd(HeaterId); } /*else //heater off, and the heater is not ready yet { -- cgit v1.3.1 From 67b80be819c29407dc07f80a7f61e5da2995ba93 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Mon, 13 Aug 2018 12:23:30 +0300 Subject: fix / improve heaters off handling --- Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index ff5af5aac..f1332ca98 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -124,6 +124,8 @@ uint32_t HeatersSingleHeaterEnd(HardwarePidControlType HeaterId) { status |= RemoveControlCallback(ControlIdtoHeaterId [HeaterId], DCHeaterControlCBFunction); ControlIdtoHeaterId [HeaterId]=0xFF; + HeaterRecalculateHeaterParams(HeaterId, 0); + } DeActivateHeater(HeaterId); } @@ -132,6 +134,7 @@ uint32_t HeatersSingleHeaterEnd(HardwarePidControlType HeaterId) if (ControlIdtoHeaterId [HeaterId]!=0xFF) { status |=RemoveControlCallback(ControlIdtoHeaterId [HeaterId] ,HeaterControlCBFunction); + HeaterRecalculateSharedHeatersParams(HeaterId,0); ControlIdtoHeaterId [HeaterId]=0xFF; } if (MainDryerHeaterMaxTempControl) @@ -511,6 +514,7 @@ uint32_t DCHeaterControlCBFunction(uint32_t IfIndex, uint32_t readValue) } if (HeaterCmd[index].targettemperatue == 0) { + DeActivateHeater(index); LOG_ERROR (index, "unconfigured"); return ERROR; } -- cgit v1.3.1