From ba3d7e34700be27d5eed1c2a58f6cd146296fd95 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Thu, 9 Aug 2018 10:34:56 +0300 Subject: fixed screw homing --- .../Modules/Diagnostics/DiagnosticsHoming.c | 44 ++++++++++++++++++++-- 1 file changed, 41 insertions(+), 3 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c index 4e573cb82..33af819f1 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c @@ -76,6 +76,44 @@ FPGA_GPI_ENUM Motor_Id_to_LS_Id[NUM_OF_MOTORS] = { MAX_GPI, //MOTO_SPARE2_1 = 27, MAX_GPI, //MOTO_SPARE2_2 = 28 +}; +typedef enum { + MotorHomingDirectionUp, + MotorHomingDirectionDown, + MotorHomingDirectionNoHoming +}MotorHomingDirectionEnum; + +MotorHomingDirectionEnum Motor_Id_to_LS_Direction[NUM_OF_MOTORS] = { + MotorHomingDirectionNoHoming, //MOTO_DH_CLEANHEAD = 0, + MotorHomingDirectionNoHoming, //MOTO_DH_CLEANMECH = 1, + MotorHomingDirectionNoHoming, //MOTO_DH_LID = 2, + MotorHomingDirectionNoHoming, //MOTO_DRYER_DRIVING = 3, + MotorHomingDirectionNoHoming, //MOTO_DRYER_LID = 4, + MotorHomingDirectionNoHoming, //MOTO_DRYER_LOADARM = 5, + MotorHomingDirectionDown, //MOTO_DISPENSER_1 = 6, + MotorHomingDirectionDown, //MOTO_DISPENSER_2 = 7, + MotorHomingDirectionDown, //MOTO_DISPENSER_3 = 8, + MotorHomingDirectionDown, //MOTO_DISPENSER_4 = 9, + MotorHomingDirectionDown, //MOTO_DISPENSER_5 = 10, + MotorHomingDirectionDown, //MOTO_DISPENSER_6 = 11, + MotorHomingDirectionDown, //MOTO_DISPENSER_7 = 12, + MotorHomingDirectionDown, //MOTO_DISPENSER_8 = 13, + MotorHomingDirectionUp, //MOTO_SCREW = 14, + MotorHomingDirectionNoHoming, //MOTO_WINDER = 15, + MotorHomingDirectionDown, //MOTO_LDANCER1 = 16, + MotorHomingDirectionDown, //MOTO_LDANCER2 = 17, + MotorHomingDirectionNoHoming, //MOTO_LDRIVING = 18, + MotorHomingDirectionUp, //MOTO_LLOADING = 19, + MotorHomingDirectionUp, //MOTO_LPIVOT1 = 20, + MotorHomingDirectionDown, //MOTO_RDANCER = 21, + MotorHomingDirectionNoHoming, //MOTO_RDRIVING = 22, + MotorHomingDirectionUp, //MOTO_RLOADARM = 23, + MotorHomingDirectionDown, //MOTO_RLOADING = 24, + MotorHomingDirectionNoHoming, //MOTO_SPARE1_1 = 25, + MotorHomingDirectionNoHoming, //MOTO_SPARE1_2 = 26, + MotorHomingDirectionNoHoming, //MOTO_SPARE2_1 = 27, + MotorHomingDirectionNoHoming, //MOTO_SPARE2_2 = 28 + }; char HomingToken[NUM_OF_MOTORS][36+1]={0}; @@ -87,13 +125,13 @@ uint32_t MotorHomingRequestCallback(uint32_t deviceID, uint32_t ReadValue) MessageContainer responseContainer; MotorHomingResponse response = MOTOR_HOMING_RESPONSE__INIT; - responseContainer = createContainer(MESSAGE_TYPE__MotorHomingResponse, HomingToken[deviceID], false, &response, &motor_homing_response__pack, &motor_homing_response__get_packed_size); - responseContainer.continuous = false; - HomingToken[deviceID][0] = 0; + responseContainer = createContainer(MESSAGE_TYPE__MotorHomingResponse, HomingToken[deviceID], true, &response, &motor_homing_response__pack, &motor_homing_response__get_packed_size); + responseContainer.continuous = true; uint8_t* container_buffer = malloc(message_container__get_packed_size(&responseContainer)); size_t container_size = message_container__pack(&responseContainer, container_buffer); free(responseContainer.data.data); SendChars(container_buffer, container_size); + HomingToken[deviceID][0] = 0; return OK; -- cgit v1.3.1 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) --- .../Communication/PMR/Diagnostics/EventType.pb-c.c | 20 +- .../Communication/PMR/Diagnostics/EventType.pb-c.h | 7 +- .../Embedded/Drivers/SSI_Comm/Dancer/Dancer.h | 1 + .../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 + Software/PMR/Messages/Diagnostics/EventType.proto | 27 ++- 10 files changed, 323 insertions(+), 18 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/EventType.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/EventType.pb-c.c index 0baefc64c..7f8ff964c 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/EventType.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/EventType.pb-c.c @@ -7,7 +7,7 @@ #endif #include "EventType.pb-c.h" -static const ProtobufCEnumValue event_type__enum_values_by_number[39] = +static const ProtobufCEnumValue event_type__enum_values_by_number[44] = { { "ThreadBreak", "EVENT_TYPE__ThreadBreak", 0 }, { "ThreadTensionControlFailure", "EVENT_TYPE__ThreadTensionControlFailure", 1 }, @@ -48,11 +48,16 @@ static const ProtobufCEnumValue event_type__enum_values_by_number[39] = { "RecordingStarted", "EVENT_TYPE__RecordingStarted", 36 }, { "RecordingStopped", "EVENT_TYPE__RecordingStopped", 37 }, { "JobStatus", "EVENT_TYPE__JobStatus", 38 }, + { "DispenserPressure", "EVENT_TYPE__DispenserPressure", 39 }, + { "MotorOverCurrent", "EVENT_TYPE__MotorOverCurrent", 40 }, + { "MotorOverTemperature", "EVENT_TYPE__MotorOverTemperature", 41 }, + { "MotorUnderVoltage", "EVENT_TYPE__MotorUnderVoltage", 42 }, + { "MotorStall", "EVENT_TYPE__MotorStall", 43 }, }; static const ProtobufCIntRange event_type__value_ranges[] = { -{0, 0},{0, 39} +{0, 0},{0, 44} }; -static const ProtobufCEnumValueIndex event_type__enum_values_by_name[39] = +static const ProtobufCEnumValueIndex event_type__enum_values_by_name[44] = { { "AirFilterClogged", 13 }, { "AirFilterNotInstalled", 14 }, @@ -63,6 +68,7 @@ static const ProtobufCEnumValueIndex event_type__enum_values_by_name[39] = { "DHThermalCutoff", 7 }, { "DispenserEmpty", 18 }, { "DispenserLowLevel", 19 }, + { "DispenserPressure", 39 }, { "DispenserRefillFailure", 20 }, { "DryerDHeadCoverOpen", 12 }, { "DryerHeatersCurrentOutOfRange", 11 }, @@ -78,6 +84,10 @@ static const ProtobufCEnumValueIndex event_type__enum_values_by_name[39] = { "MidTankEmpty", 21 }, { "MidTankLowLevel", 22 }, { "MidTankNotInPlace", 23 }, + { "MotorOverCurrent", 40 }, + { "MotorOverTemperature", 41 }, + { "MotorStall", 43 }, + { "MotorUnderVoltage", 42 }, { "RecordingStarted", 36 }, { "RecordingStopped", 37 }, { "RequestFailed", 31 }, @@ -101,9 +111,9 @@ const ProtobufCEnumDescriptor event_type__descriptor = "EventType", "EventType", "", - 39, + 44, event_type__enum_values_by_number, - 39, + 44, event_type__enum_values_by_name, 1, event_type__value_ranges, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/EventType.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/EventType.pb-c.h index 0d9171e51..ec7257885 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/EventType.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/EventType.pb-c.h @@ -58,7 +58,12 @@ typedef enum _EventType { EVENT_TYPE__ApplicationTerminated = 35, EVENT_TYPE__RecordingStarted = 36, EVENT_TYPE__RecordingStopped = 37, - EVENT_TYPE__JobStatus = 38 + EVENT_TYPE__JobStatus = 38, + EVENT_TYPE__DispenserPressure = 39, + EVENT_TYPE__MotorOverCurrent = 40, + EVENT_TYPE__MotorOverTemperature = 41, + EVENT_TYPE__MotorUnderVoltage = 42, + EVENT_TYPE__MotorStall = 43 PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(EVENT_TYPE) } EventType; diff --git a/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.h b/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.h index 8d21de87b..258e1b8fe 100644 --- a/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.h +++ b/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.h @@ -7,6 +7,7 @@ #ifndef DRIVERS_SSI_COMM_DANCER_DANCER_H_ #define DRIVERS_SSI_COMM_DANCER_DANCER_H_ +#include "PMR/Hardware/HardwareDancerType.pb-c.h" uint32_t Read_Dancer_Position (HardwareDancerType DancerId); uint32_t Control_Read_Dancer_Position(HardwareDancerType DancerId, uint32_t Parameter1, uint32_t Parameter2); 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); diff --git a/Software/PMR/Messages/Diagnostics/EventType.proto b/Software/PMR/Messages/Diagnostics/EventType.proto index a613211d9..5376b870b 100644 --- a/Software/PMR/Messages/Diagnostics/EventType.proto +++ b/Software/PMR/Messages/Diagnostics/EventType.proto @@ -106,13 +106,13 @@ enum EventType //Occurs a request has been sent to the machine or external bridge service (Group = Transport, Category = Info, Actions = ) RequestSent = 29; - //Occures when a response has been received (Group = Transport, Category = Info, Actions = ) + //Occurs when a response has been received (Group = Transport, Category = Info, Actions = ) ResponseReceived = 30; - //Occures when a request to the machine has failed (Group = Transport, Category = Error, Actions = ) + //Occurs when a request to the machine has failed (Group = Transport, Category = Error, Actions = ) RequestFailed = 31; - //Occures when the application has encountered some error (Group = Application, Category = Error, Actions = ) + //Occurs when the application has encountered some error (Group = Application, Category = Error, Actions = ) ApplicationException = 32; //General application event logs (Group = Application, Category = Info, Actions = ) @@ -124,13 +124,28 @@ enum EventType //Notifies about application termination (Group = Application, Category = Info, Actions = ) ApplicationTerminated = 35; - //Occures when a diagnostics recording has been started (Group = Application, Category = Info, Actions = ) + //Occurs when a diagnostics recording has been started (Group = Application, Category = Info, Actions = ) RecordingStarted = 36; - //Occures when a diagnostics recording has been stopped (Group = Application, Category = Info, Actions = ) + //Occurs when a diagnostics recording has been stopped (Group = Application, Category = Info, Actions = ) RecordingStopped = 37; - //Occures when a job status message has been received from the embedded device (Group = Application, Category = Info, Actions = ) + //Occurs when a job status message has been received from the embedded device (Group = Application, Category = Info, Actions = ) JobStatus = 38; + //Occurs when the pressure at the dispenser is too high + DispenserPressure = 39; + + // Occurs when a motor driver reports too high current on the motor + MotorOverCurrent = 40; + + // Occurs when a motor drivershuts down the motor due to a too high temperature + MotorOverTemperature = 41; + + // Occurs when a motor driver reports too low voltage on the motor + MotorUnderVoltage = 42; + + // Occurs when a motor driver reports too high current on the motor + MotorStall = 43; + } -- 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') 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