From c072840a7e3f4530afb55aaad1f81e4ae8667e8b Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Sun, 10 May 2020 18:35:12 +0300 Subject: bug fixes and investigations. IFS brushstop closing, waste tank diagnostics, heaters hangout handling --- .../Embedded/Modules/AlarmHandling/AlarmHandling.c | 9 ++++++++ .../Embedded/Modules/Control/MillisecTask.c | 4 +++- .../Embedded/Modules/Diagnostics/Diagnostics.c | 4 ++++ .../Embedded/Modules/Heaters/Heaters_print.c | 25 ++++++++++++++-------- .../Embedded_SW/Embedded/Modules/IDS/IDS_print.c | 3 ++- 5 files changed, 34 insertions(+), 11 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 72da194e0..437a361f4 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c @@ -810,7 +810,16 @@ JobEndReasonEnum AlarmHandlingPrepareJob(void *CurrentJob) // DispenserInUse[Dispenser_i] = false; //} JobEndReasonEnum status = JOB_OK; + Task_Handle TaskHandle1 = Task_self(); + int pri = Task_getPri(TaskHandle1); + + ACTIVITY_GREEN_LED_ON; + Task_setPri(TaskHandle1, 3); + Report("Task_setPri", __FILE__, pri, 3, RpWarning, (int)TaskHandle1, 0); IDS_MapDispenserUsedinJob(CurrentJob); + Task_setPri(TaskHandle1, pri); + Report("Task_setPri", __FILE__, __LINE__, pri, RpWarning, (int)Task_self(), 0); + ACTIVITY_GREEN_LED_OFF; if (n_segments == 0) return JOB_OK; if (AlarmItem == NULL) diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index af3ba7668..e0d1e38de 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -742,7 +742,7 @@ uint32_t MillisecLowLoop(uint32_t tick) // #warning TBD need to define the timing if(Whs_emptying_cycle >= 2) { - //waste_seq_step1();// include 1Sec delay + waste_seq_step1();// include 1Sec delay Whs_emptying_cycle = 0; } else @@ -773,6 +773,8 @@ uint32_t MillisecLowLoop(uint32_t tick) midtankDisplay = 1-midtankDisplay; /*if (WHS_Type == WHS_TYPE_UNKNOWN) Gas_PPM_Info = Calculate_Gas_Power_Consumption();*/ + if (WHS_Type == WHS_TYPE_NEW) + ReportWithPackageFilter(ThreadFilter,"waste tank calculate level",__FILE__,__LINE__,(int)(GetWHSWasteTankLevelMiliLiter()*1000),RpWarning,(int) msec_millisecondCounter,0); //Trigger_WHS_MAX11614_Read_allADC(); #ifdef CONTROL_DEBUG ResetControlTime(); diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index dee07827f..56917391a 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -115,6 +115,7 @@ double HeadFlowMeter; double tempFlow = 0.0; double DrierFlowMeter; double AcVoltage; +double WasteLevel = 0.0; double HeatersCurrent[NUM_OF_CURRENT_HEATERS][1]; double HeadCurrent[MAX_FLAT_HEAD_HEATERS][1]; double VOC_Sensor; @@ -728,6 +729,9 @@ void DiagnosticOneSecCollection(void) Report("Head flow change 1m",__FILE__,(int)diagvoltage,(int)tempFlow,RpWarning,(int)HeadFlowMeter,0); tempFlow = HeadFlowMeter; } + DiagnosticsMonitor.n_chillertemperature = 1; + WasteLevel = GetWHSWasteTankLevelMiliLiter(); + DiagnosticsMonitor.chillertemperature = &WasteLevel; } HeatersCurrent[HEATER_DRYER_CURRENT_1][0] = Get_Heaters_Current(HEATER_DRYER_CURRENT_1); HeatersCurrent[HEATER_DRYER_CURRENT_2][0] = Get_Heaters_Current(HEATER_DRYER_CURRENT_2); diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index c44043a12..634249674 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -611,7 +611,7 @@ uint32_t HeaterCommandRequestMessage(int HeaterNum, bool OnOff, int Temperature else { //HeaterPreviousRead[HeaterId] = MillisecGetTemperatures(HeaterId);// - ReportWithPackageFilter(HeatersFilter,"Restarting same temperature Heater Temp",__FILE__,HeaterId,ControlIdtoHeaterId [HeaterId],RpWarning,HeaterPreviousRead[HeaterId], 0); + ReportWithPackageFilter(HeatersFilter,"Restarting same temperature Heater Temp",__FILE__,HeaterId,HeaterPIDConfig[HeaterId].m_calculatedError,RpWarning,HeaterPreviousRead[HeaterId], 0); HeaterRestarted[HeaterId] = true; } //PrepareHeater(HeaterId,Temperature); //prepare the heaters control info @@ -939,7 +939,7 @@ uint32_t HeaterMaxTempCBFunction(uint32_t IfIndex, uint32_t readValue) if (HeaterMaxTempFlag[index] == false) { //LOG_ERROR (MaxreadValue/100, "Heater Over the max temperature, turned off"); - //ReportWithPackageFilter(HeatersFilter," AC Heater Over the max temperature, turned off",__FILE__,index,HeaterReady[index],RpWarning,HeaterControl[index].sensormaxvalue, 0); + ReportWithPackageFilter(HeatersFilter," AC Heater Over the max temperature, turned off",__FILE__,index,HeaterReady[index],RpWarning,HeaterControl[index].sensormaxvalue, 0); } DeActivateHeater(HEATER_TYPE__DryerMainHeater); HeaterMaxTempFlag[index] = true; @@ -983,7 +983,6 @@ uint32_t DcHeaterMaxTempCBFunction(uint32_t IfIndex, uint32_t readValue) return OK; if ((HeaterPreviousRead[index]) >= HeaterControl[index].sensormaxvalue) { - ReportWithPackageFilter(HeatersFilter,"Heater over the max temperature",__FILE__,index,OverHeatCounter[index],RpWarning,HeaterControl[index].sensormaxvalue, 0); if(OverHeatCounter[index]++ >=Overheat_Count_Limit) { OverHeatCounter[index] = Overheat_Count_Limit; @@ -1002,9 +1001,12 @@ uint32_t DcHeaterMaxTempCBFunction(uint32_t IfIndex, uint32_t readValue) HeaterRecalculateHeaterParams(index, 0); HeaterMaxTempFlag[index] = true; //ReportWithPackageFilter(HeatersFilter,(MinreadValue/100), "Heater Over the max temperature, turned off"); - ReportWithPackageFilter(HeatersFilter,"DC Heater Over the max temperature, turned off",__FILE__,index,HeaterPreviousRead[index],RpWarning, HeaterReady[index],0); if (getIdleState() == false) + { + ReportWithPackageFilter(HeatersFilter,"DC Heater Over the max temperature, turned off",__FILE__,index,HeaterPreviousRead[index],RpWarning, HeaterReady[index],0); + ReportWithPackageFilter(HeatersFilter,"Heater over the max temperature",__FILE__,index,OverHeatCounter[index],RpWarning,HeaterControl[index].sensormaxvalue, 0); AlarmHandlingSetAlarm(HeaterEventType[index], true); + } return OK; } else if ((HeaterPreviousRead[index]) < (HeaterControl[index].sensorminvalue)) @@ -1120,7 +1122,7 @@ uint32_t HeaterControlCBFunction(uint32_t IfIndex, uint32_t readValue) HeaterPreviousRead[index] = readValue; //ReportWithPackageFilter(HeatersFilter, "AC Heating in progress",__FILE__,readValue,HeaterReady[index],RpError, HeaterAtTemp[index],0); - if (readValue>(HeaterCmd[index].targettemperatue+800)) + if ((readValue>(HeaterCmd[index].targettemperatue+800))&&(getIdleState() == false)) { ReportWithPackageFilter(HeatersFilter, "AC OverHeating in progress",__FILE__,readValue,HeaterReady[index],RpError, HeaterAtTemp[index],0); } @@ -1321,10 +1323,14 @@ uint32_t DCHeaterControlCBFunction(uint32_t IfIndex, uint32_t readValue) HeaterRecalculateHeaterParams(index, 0); return ERROR; } - if (readValue>(HeaterCmd[index].targettemperatue+500)) + if ((readValue>(HeaterCmd[index].targettemperatue+300))&&(getIdleState() == false)) { - ReportWithPackageFilter(HeatersFilter, "DC OverHeating in progress",__FILE__,index,readValue,RpError, HeaterReady[index],0); + ReportWithPackageFilter(HeatersFilter, "DC OverHeating in progress",__FILE__,index,readValue,RpError, HeaterPIDConfig[index].m_calculatedError,0); } + /*if (index == 4) + { + ReportWithPackageFilter(HeatersFilter, "DC Heating info head 2",__FILE__,GetControlLowDevice_i(),readValue,RpError, HeaterPIDConfig[index].m_calculatedError,0); + }*/ // check if the read value is within the proportional band if (HeaterReady[index]==false) @@ -1335,7 +1341,8 @@ uint32_t DCHeaterControlCBFunction(uint32_t IfIndex, uint32_t readValue) DeActivateHeater(index); HeaterRecalculateHeaterParams(index, 0); //Heaters OFF until coming into the proportional band - ReportWithPackageFilter(HeatersFilter,"HEATER Over temperature ", __FILE__,index,HeaterCmd[index].targettemperatue, RpMessage, readValue, 0); + if (getIdleState() == false) + ReportWithPackageFilter(HeatersFilter,"HEATER Over temperature ", __FILE__,index,HeaterCmd[index].targettemperatue, RpMessage, readValue, 0); return OK; } if (readValue < ((HeaterCmd[index].targettemperatue * (100-HeaterControl[index].outputproportionalband))/100)) @@ -1423,7 +1430,7 @@ uint32_t DCHeaterControlCBFunction(uint32_t IfIndex, uint32_t readValue) // #warning PID is now only proportional (above) if (HeaterRestarted[index] == true) { - ReportWithPackageFilter(HeatersFilter,"Restarting same temperature Heater Temp",__FILE__,index,HeaterPIDConfig[index].m_calculatedError,RpWarning,readValue, 0); + ReportWithPackageFilter(HeatersFilter,"Restarted same temperature Heater ",__FILE__,index,HeaterPIDConfig[index].m_calculatedError,RpWarning,readValue, 0); HeaterRestarted[index] = false; } HeaterRecalculateHeaterParams(index, (int)(HeaterPIDConfig[index].m_calculatedError/100)); diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index 5ca59a434..ae6751693 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -1491,6 +1491,7 @@ uint32_t IDSBrushStopRestartCallback(uint32_t IfIndex, uint32_t readValue) Report("JobEndSequence",__FILE__,__LINE__,(int)JobBrushStopId,RpWarning,(int)SegmentNumOfBrushStops,0); SafeRemoveControlCallback(BrushStopControlId,IDSBrushStopRestartCallback); BrushStopControlId = 0Xff; + return OK; } if (uploadstrategy == JOB_UPLOAD_STRATEGY__Default) { @@ -1506,7 +1507,7 @@ uint32_t IDSBrushStopRestartCallback(uint32_t IfIndex, uint32_t readValue) { Task_stat(Control_Task_Handle,&statbuf); //REPORT_MSG(FileBrushStop->index,"BrushStopRead Index"); - Report("BrushStopRead Index",__FILE__,__LINE__,(int)FileBrushStop->index,RpWarning,(int)statbuf.used,0); + Report("BrushStopRead Index",__FILE__,BrushStopTime,(int)FileBrushStop->index,RpWarning,(int)BrushStopStartTime,0); Dispensers = FileBrushStop->dispensers; n_dispensers = FileBrushStop->n_dispensers; } -- cgit v1.3.1 From 0b31b5f619df5537e73560019b63979a380a121d Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Mon, 11 May 2020 23:29:30 +0300 Subject: fix flash problems, whs problems --- .../I2C_Communication/Head_Card/IO_Ports/Head_IO.c | 18 ++++++--- .../WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c | 13 +++++-- .../WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c | 2 +- .../Embedded/Drivers/flash_ram/FlashProgram.c | 13 +++---- .../Embedded/Drivers/flash_ram/FlashProgram.h | 16 +++++--- .../Embedded/Modules/AlarmHandling/AlarmHandling.c | 2 +- .../Embedded/Modules/Diagnostics/Diagnostics.c | 4 +- .../Embedded/Modules/General/GeneralHardware.c | 17 +++++---- .../Embedded_SW/Embedded/Modules/General/process.c | 4 +- .../Embedded/Modules/Heaters/Heaters_print.c | 31 ++++++++++----- .../Embedded/Modules/IDS/IDS_dispenser.c | 2 +- Software/Embedded_SW/Embedded/Modules/IFS/ifs.c | 44 +++++++++++++--------- .../Embedded/Modules/Thread/ThreadLoad.c | 16 +++++--- .../Embedded/Modules/Thread/Thread_Winder.c | 2 +- .../StateMachines/Initialization/InitSequence.c | 5 ++- 15 files changed, 118 insertions(+), 71 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/IO_Ports/Head_IO.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/IO_Ports/Head_IO.c index 22a09f6ef..378794b5e 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/IO_Ports/Head_IO.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/IO_Ports/Head_IO.c @@ -271,9 +271,12 @@ uint32_t HeadCard_ActivateHeadMagnet() { uint32_t status = OK; - Head_I2C_EXP2_0x42.bits.OUTPUT_MAG_EN = ENABLE; - Head_I2C_EXP2_0x42.bits.OUTPUT_MAG_DIR = 0x01;//? - status |= Head_Write_IO_Reg(0x42,LOW_AND_HIGH); + if(Head_Type == HEAD_TYPE_SYLKO) + { + Head_I2C_EXP2_0x42.bits.OUTPUT_MAG_EN = ENABLE; + Head_I2C_EXP2_0x42.bits.OUTPUT_MAG_DIR = 0x01;//? + status |= Head_Write_IO_Reg(0x42,LOW_AND_HIGH); + } return status; } @@ -282,9 +285,12 @@ uint32_t HeadCard_DeActivateHeadMagnet() { uint32_t status = OK; - Head_I2C_EXP2_0x42.bits.OUTPUT_MAG_EN = ENABLE; - Head_I2C_EXP2_0x42.bits.OUTPUT_MAG_DIR = 0x00;//? - status |= Head_Write_IO_Reg(0x42,LOW_AND_HIGH); + if(Head_Type == HEAD_TYPE_SYLKO) + { + Head_I2C_EXP2_0x42.bits.OUTPUT_MAG_EN = ENABLE; + Head_I2C_EXP2_0x42.bits.OUTPUT_MAG_DIR = 0x00;//? + status |= Head_Write_IO_Reg(0x42,LOW_AND_HIGH); + } return status; } diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c index 93e0d770d..80cfb8ac6 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c @@ -217,7 +217,11 @@ bool Test_WHS_max11614() // ReportWithPackageFilter(WasteFilter,"------------ calc Q value (calc)-----------------", __FILE__,__LINE__, calc, RpMessage, num, 0); // return calc; //} - +double CurrentQ[DRIER_FLOW_METER+1]; +double get_CurrentQ(WHS_Flow_Meter num) +{ + return CurrentQ[num]; +} double get_Q(WHS_Flow_Meter num) { double Sqrt = 0; @@ -249,6 +253,7 @@ double get_Q(WHS_Flow_Meter num) { calc = 0; } + CurrentQ[num] = calc; ReportWithPackageFilter(WasteFilter,"------------ calc Q value (calc) (flow num)-----------------", __FILE__,__LINE__, (int)(calc*100), RpMessage, num, 0); return calc; } @@ -357,7 +362,7 @@ double GetWHSAirFlow(uint8_t OR_Id) { //get_orf_3(&value); //Q_value = get_Q(value-orf3V0Value); - Q_value = get_Q(DRIER_FLOW_METER); + Q_value = get_CurrentQ(DRIER_FLOW_METER); } break; case NU_FLOW_METER: @@ -370,8 +375,8 @@ double GetWHSAirFlow(uint8_t OR_Id) } else //CURRENT { - get_orf_1(&value); - Q_value = get_Q(HEAD_FLOW_METER); + //get_orf_1(&value); + Q_value = get_CurrentQ(HEAD_FLOW_METER); } break; default: diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c index 6e6f38dfb..8e8c5dacf 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c @@ -431,7 +431,7 @@ void WHS_Start_Blower_Control_Closed_Loop () static uint8_t count = 0; - if (GetMachineState()=MAX_CONT_LOG) RxIndex = 0; #endif - for(ui32Idx = ui32FlashStart; ui32Idx < ui32FlashStart+ui32FileSize; ui32Idx += 1024) - { - //status = FlashErase(ui32Idx); - } - return OK; + status = FlashErase(ui32Idx); + return status; } //Each word may not be subject to more than a specific number of programming cycles before an diff --git a/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.h b/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.h index ae0ca32e9..983c3954c 100644 --- a/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.h +++ b/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.h @@ -10,13 +10,19 @@ #define FLASH_RAM_BASE 0x000F0000 +#define EMBEDDED_PARAMETERS_SECTION_FLASH (FLASH_RAM_BASE + 0X0000 ) +#define PROCESS_PARAMETERS_SECTION_FLASH (FLASH_RAM_BASE + 0X0000 ) +#define DANCERS_SECTION_FLASH (FLASH_RAM_BASE + 0X0000) +#define DISPENSERS_SECTION_FLASH (FLASH_RAM_BASE + 0X4000) +#define ALARM_SECTION_FLASH (FLASH_RAM_BASE + 0XC000 ) +#define GENHWCFG_SECTION_FLASH (FLASH_RAM_BASE + 0X8000) + #define EMBEDDED_PARAMETERS_MAP_IN_FLASH (FLASH_RAM_BASE + 0X0000 ) #define PROCESS_PARAMETERS_MAP_IN_FLASH (FLASH_RAM_BASE + 0X0400 ) #define DANCERS_MAP_IN_FLASH (FLASH_RAM_BASE + 0X0500) -#define DISPENSERS_MAP_IN_FLASH (FLASH_RAM_BASE + 0X1000) -#define ALARM_MAP_IN_FLASH (FLASH_RAM_BASE + 0X2000 ) -#define GENHWCFG_MAP_IN_FLASH (FLASH_RAM_BASE + 0X6000) -#define OTHER_MAP_IN_FLASH (FLASH_RAM_BASE + 0X8000) +#define DISPENSERS_MAP_IN_FLASH (FLASH_RAM_BASE + 0X4000) +#define ALARM_MAP_IN_FLASH (FLASH_RAM_BASE + 0XC000 ) +#define GENHWCFG_MAP_IN_FLASH (FLASH_RAM_BASE + 0X8000) #define FLASH_SIZE 0X10000 @@ -30,7 +36,7 @@ //***************************************************************************** uint32_t ReadAppAndProgram(uint32_t ui32FlashStart,uint32_t ui32FileSize,void* buffer); void FlashInit(void); -uint32_t EraseFlashSection(uint32_t ui32FlashStart,uint32_t ui32FileSize); +uint32_t EraseFlashSection(uint32_t ui32FlashStart); diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c index 437a361f4..a8e0c3138 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c @@ -472,7 +472,7 @@ uint32_t AlarmHandlingLoadFile(void) maxAlarms = AlarmParametersTable->n_alarmitem; p_size = AlarmParametersTable->n_alarmitem*sizeof(AlarmHandlingItemStruc); ReportWithPackageFilter(AlarmFilter,"Writing alarm size", __FILE__,pAlarmItemSize,AlarmParametersTable->n_alarmitem, RpMessage, p_size, 0); - EraseFlashSection(pAlarmItemSize,p_size+4); + EraseFlashSection(ALARM_SECTION_FLASH); ReadAppAndProgram(pAlarmItemSize, 4,&p_size); AlarmPtr = (int)pAlarmItemSize+4; p_size = 0; diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index 56917391a..1390e23e0 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -681,7 +681,7 @@ void DiagnosticOneMinuteCollection(void) HeadFlowMeter = GetWHSAirFlow(HEAD_FLOW_METER); if (fabs(tempFlow - HeadFlowMeter)>0.05) { - Report("Head flow change 1s",__FILE__,(int)diagvoltage,(int)tempFlow,RpWarning,(int)HeadFlowMeter,0); + Report("Head flow change 1m",__FILE__,(int)diagvoltage,(int)(tempFlow*1000),RpWarning,(int)(HeadFlowMeter*1000),0); tempFlow = HeadFlowMeter; } DiagnosticsMonitor.n_headairflow = 1; @@ -726,7 +726,7 @@ void DiagnosticOneSecCollection(void) DiagnosticsMonitor.headairflow = &HeadFlowMeter; if (fabs(tempFlow - HeadFlowMeter)>0.25) { - Report("Head flow change 1m",__FILE__,(int)diagvoltage,(int)tempFlow,RpWarning,(int)HeadFlowMeter,0); + Report("Head flow change 1s",__FILE__,(int)diagvoltage,(int)(tempFlow*1000),RpWarning,(int)(HeadFlowMeter*1000),0); tempFlow = HeadFlowMeter; } DiagnosticsMonitor.n_chillertemperature = 1; diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index b86f602af..e2ee53645 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -116,7 +116,7 @@ uint32_t HWConfigurationInit(void) buffer = HWConfigurationLoadFromFile(&Bytes); //load hardware config if (buffer) { - EraseFlashSection(GENHWCFG_MAP_IN_FLASH,Bytes+4); + EraseFlashSection(GENHWCFG_SECTION_FLASH); ReadAppAndProgram(GENHWCFG_MAP_IN_FLASH, 4,&Bytes); ReadAppAndProgram(GENHWCFG_MAP_IN_FLASH+4, Bytes, buffer); UploadRequest = upload_hardware_configuration_request__unpack(NULL, Bytes, buffer); @@ -263,11 +263,11 @@ void LoadConfigurationParameters(ConfigurationParameters *Params) size_t response_size = 0; if (response_buffer) { - response_size = configuration_parameters__pack(EmbeddedParameters, response_buffer); + /*response_size = configuration_parameters__pack(EmbeddedParameters, response_buffer); //FileWrite(response_buffer,response_size,EmbeddedParametersPath); - EraseFlashSection(EMBEDDED_PARAMETERS_MAP_IN_FLASH,response_size+4); + EraseFlashSection(EMBEDDED_PARAMETERS_SECTION_FLASH); ReadAppAndProgram(EMBEDDED_PARAMETERS_MAP_IN_FLASH, 4,&response_size); - ReadAppAndProgram(EMBEDDED_PARAMETERS_MAP_IN_FLASH+4, response_size, response_buffer); + ReadAppAndProgram(EMBEDDED_PARAMETERS_MAP_IN_FLASH+4, response_size, response_buffer);*/ my_free(response_buffer); } } @@ -632,8 +632,8 @@ uint32_t HWConfigurationFunc(MessageContainer* requestContainer) MessageContainer responseContainer; UploadHardwareConfigurationResponse response = UPLOAD_HARDWARE_CONFIGURATION_RESPONSE__INIT; - EraseFlashSection(GENHWCFG_MAP_IN_FLASH,requestContainer->data.len+4); DataLen = requestContainer->data.len; + EraseFlashSection(GENHWCFG_SECTION_FLASH); ReadAppAndProgram(GENHWCFG_MAP_IN_FLASH, 4,&DataLen); ReadAppAndProgram(GENHWCFG_MAP_IN_FLASH+4, DataLen, requestContainer->data.data); @@ -720,7 +720,7 @@ uint32_t LoadConfigurationParamsFromFile(bool Initialize) //configuration_parameters__free_unpacked(Params,NULL); FlashInitResults[1] = true; Report("Parameters Initialized from file", __FILE__,__LINE__,Bytes, RpMessage, EMBEDDED_PARAMETERS_MAP_IN_FLASH, 0); - EraseFlashSection(EMBEDDED_PARAMETERS_MAP_IN_FLASH,Bytes+4); + EraseFlashSection(EMBEDDED_PARAMETERS_SECTION_FLASH); ReadAppAndProgram(EMBEDDED_PARAMETERS_MAP_IN_FLASH, 4,&Bytes); ReadAppAndProgram(EMBEDDED_PARAMETERS_MAP_IN_FLASH+4, Bytes, buffer); if (Initialize) @@ -735,6 +735,7 @@ void HWConfigurationLoadFile(void) buffer = HWConfigurationLoadFromFile(&Bytes); //load hardware config if (buffer) { + EraseFlashSection(GENHWCFG_SECTION_FLASH); ReadAppAndProgram(GENHWCFG_MAP_IN_FLASH, 4,&Bytes); ReadAppAndProgram(GENHWCFG_MAP_IN_FLASH+4, Bytes, buffer); free (buffer); @@ -765,7 +766,8 @@ void FlashInitAndLoad(void) buffer = HWConfigurationLoadFromFile(&Bytes); //load hardware config if (buffer) { - ReadAppAndProgram(GENHWCFG_MAP_IN_FLASH, 4,&Bytes); + EraseFlashSection(GENHWCFG_SECTION_FLASH); + ReadAppAndProgram(GENHWCFG_MAP_IN_FLASH, 4,&Bytes); ReadAppAndProgram(GENHWCFG_MAP_IN_FLASH+4, Bytes, buffer); free (buffer); FlashInitResults[0] = true; @@ -779,6 +781,7 @@ void FlashInitAndLoad(void) { Report("Alarm Initialized from file", __FILE__,__LINE__,Bytes, RpMessage, ALARM_MAP_IN_FLASH, 0); } + EraseFlashSection(EMBEDDED_PARAMETERS_SECTION_FLASH); Fresult = FileRead(EmbeddedParametersPath, &Bytes, &buffer); if (Fresult == FR_OK) diff --git a/Software/Embedded_SW/Embedded/Modules/General/process.c b/Software/Embedded_SW/Embedded/Modules/General/process.c index 6d04f2f59..ab4c6daac 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/process.c +++ b/Software/Embedded_SW/Embedded/Modules/General/process.c @@ -120,7 +120,7 @@ uint32_t HandleProcessParameters(ProcessParameters* ProcessParams,bool saveData) { Bytes = sizeof(ProcessParameters); FileWrite(ProcessParams,Bytes,ProcessParamsConfigPath,BIOS_WAIT_FOREVER); - EraseFlashSection(PROCESS_PARAMETERS_MAP_IN_FLASH,Bytes+4); + EraseFlashSection(EMBEDDED_PARAMETERS_SECTION_FLASH); ReadAppAndProgram(PROCESS_PARAMETERS_MAP_IN_FLASH, 4,&Bytes); ReadAppAndProgram(PROCESS_PARAMETERS_MAP_IN_FLASH+4, Bytes, ProcessParams); REPORT_MSG(Bytes,"Bytes write to flash"); @@ -358,7 +358,7 @@ uint32_t LoadProcessParamsFromFile(void) if ((ProcessParams->dryerzone1temp > 0.1)&&(ProcessParams->headzone2temp > 0.1)&&(ProcessParams->headzone3temp > 0.1)&&(ProcessParams->headzone4temp > 0.1))//NOT turning off heaters { Bytes = sizeof(ProcessParameters); - EraseFlashSection(PROCESS_PARAMETERS_MAP_IN_FLASH,Bytes+4); + EraseFlashSection(EMBEDDED_PARAMETERS_SECTION_FLASH); ReadAppAndProgram(PROCESS_PARAMETERS_MAP_IN_FLASH, 4,&Bytes); ReadAppAndProgram(PROCESS_PARAMETERS_MAP_IN_FLASH+4, Bytes, ProcessParams); REPORT_MSG(Bytes,"ProcessParameters Bytes write to flash"); diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index 634249674..89bdcc66b 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -704,12 +704,18 @@ void PrepareACHeater(int HeaterId,uint32_t Frequency, uint32_t SetTemperatue) HeaterAtTemp[HeaterId] = false; if (BlowerCfg.enabled == true) { - Turn_the_Blower_On();//Turn on with the Default_Voltage - if (BlowerCfg.heatingvoltage) - Control_Voltage_To_Blower(BlowerCfg.heatingvoltage); + if(Head_Type > HEAD_TYPE_SYLKO_WITHOUT_CARD) + { + WHS_Set_SetPoint_Q_value(headairflow/2); + } else - Control_Voltage_To_Blower(BlowerCfg.voltage-500); - WHS_Set_SetPoint_Q_value(headairflow/2); + { + Turn_the_Blower_On();//Turn on with the Default_Voltage + if (BlowerCfg.heatingvoltage) + Control_Voltage_To_Blower(BlowerCfg.heatingvoltage); + else + Control_Voltage_To_Blower(BlowerCfg.voltage-500); + } } if (SetTemperatue) { @@ -1185,11 +1191,16 @@ uint32_t HeaterControlCBFunction(uint32_t IfIndex, uint32_t readValue) AlarmHandlingSetAlarm(HeaterUnderEventType[index], false); if (BlowerCfg.enabled == true) { - Turn_the_Blower_On();//Turn on with the Default_Voltage - if (BlowerCfg.voltage) - //Gradual_Increase_Blower(BlowerCfg.heatingvoltage,BlowerCfg.voltage); - Control_Voltage_To_Blower(BlowerCfg.voltage); - WHS_Set_SetPoint_Q_value(headairflow); + if(Head_Type > HEAD_TYPE_SYLKO_WITHOUT_CARD) + { + WHS_Set_SetPoint_Q_value(headairflow); + } + else + { + Turn_the_Blower_On();//Turn on with the Default_Voltage + if (BlowerCfg.voltage) + Control_Voltage_To_Blower(BlowerCfg.voltage); + } } HeaterReady[index] = true; //Disable_Reading_Heaters_Current(HeaterId2CurrentId[HEATER_TYPE__DryerMainHeater]); diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_dispenser.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_dispenser.c index 98b3704ce..bb9f0616e 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_dispenser.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_dispenser.c @@ -323,7 +323,7 @@ uint32_t IDS_Dispenser_Store_Data (void) if (JobIsActive()==false) { response_size = dispenser_data__pack(&StoreDispenserData, dispensers_container_buffer); - EraseFlashSection(DISPENSERS_MAP_IN_FLASH,response_size+4); + EraseFlashSection(DISPENSERS_SECTION_FLASH); ReadAppAndProgram(DISPENSERS_MAP_IN_FLASH, 4,&response_size); ReadAppAndProgram(DISPENSERS_MAP_IN_FLASH+4, response_size, dispensers_container_buffer); //Report("IDS_Dispenser_Store ",__FILE__,__LINE__,(int)response_size,RpWarning,(int)StoreDispenserData.dispenserinfo[4]->nanolitterperpulse *100,0); diff --git a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c index a98cc173e..572d16bb4 100644 --- a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c +++ b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c @@ -67,25 +67,28 @@ void IFS_Init(void) * the INK cartridge is empty * @return bool ret OK = 0 , CartridgeFinished = 1 */ +#define CARTRIDGE_EMPTY_QUANTITY_LIMIT 10 +#define CARTRIDGE_EMPTY_CALCULATION_TIME 6 bool DetectIfCartridgeFinished(int int_MidTank_Pressure_1000) { #define CartridgeFinished 1 bool ret = OK; - static int measure_midtank[5] ; + static int measure_midtank[CARTRIDGE_EMPTY_CALCULATION_TIME] ; static int count_measure_midtank = 0; int i=0; int sum = 0; int average = 0; - if ( count_measure_midtank == 5) count_measure_midtank = 0; + if ( count_measure_midtank == CARTRIDGE_EMPTY_CALCULATION_TIME) + count_measure_midtank = 0; measure_midtank[count_measure_midtank] = int_MidTank_Pressure_1000; count_measure_midtank += 1; - for (i=0;i<5;i++) + for (i=0;i (int_MidTank_Pressure_1000 * 0.98) ) ret = CartridgeFinished; return ret; @@ -110,7 +113,7 @@ WHS_sensor CartridgeInkCallBackFunction() { WHS_info.event = IFS_INK_presence_sensor; IFS_info.IFS_Ink_precense_sensor = !IFS_info.IFS_Ink_precense_sensor; - ReportWithPackageFilter(WasteFilter,"------------ find : IFS_Ink_presence_sensor event -----------------", __FILE__,__LINE__, IFS_info.IFS_Ink_precense_sensor, RpMessage, 0, 0); + Report("------------ find : IFS_Ink_presence_sensor event -----------------", __FILE__,__LINE__, IFS_info.IFS_Ink_precense_sensor, RpMessage, 0, 0); ret = IFS_INK_presence_sensor; } return ret; @@ -143,7 +146,7 @@ WHS_sensor CartridgeInkTimeOutCallBackFunction() MidTank_Pressure = Read_MidTank_Pressure_Sensor(IFS_info.Ink.cart_color);// Get_MidTank_Pressure_Sensor(IFS_info.Ink.cart_color); //Disable_MidTank_Pressure_Reading(IFS_info.Ink.cart_color); int_MidTank_Pressure_1000 = ((int)(MidTank_Pressure*1000)); - ReportWithPackageFilter(WasteFilter,"------------ IFS_info.Ink.time_out and Pressure -----------------", __FILE__,__LINE__,(IFS_info.Ink.time_out * SECONDS_5), RpMessage, (int_MidTank_Pressure_1000), 0); + Report("------------ IFS_info.Ink.time_out and Pressure -----------------", __FILE__,__LINE__,(IFS_info.Ink.time_out * SECONDS_5), RpMessage, (int_MidTank_Pressure_1000), 0); if (IFS_info.Ink.time_out) IFS_info.Ink.time_out += 1; /*** counter ***/ @@ -160,18 +163,24 @@ WHS_sensor CartridgeInkTimeOutCallBackFunction() /**** detect if the MidTank_Pressure is the same, 5 times ****/ if (DetectIfCartridgeFinished(int_MidTank_Pressure_1000)) { - ReportWithPackageFilter(WasteFilter,"------------ INK Cartrigde is empty (by average) -----------------", __FILE__,__LINE__,(IFS_info.Ink.time_out * SECONDS_5), RpMessage, (int_MidTank_Pressure_1000), 0); + Report("------------ INK Cartrigde is empty (by average) -----------------", __FILE__,__LINE__,(IFS_info.Ink.time_out * SECONDS_5), RpMessage, (int_MidTank_Pressure_1000), 0); IFS_info.Ink.time_out = 0; WHS_info.event = IFS_MidTankFull; return IFS_MidTankFull; } - + int timeout = CARTRIDGE_INK_TIMEOUT; + int secondtimeout = CARTRIDGE_INK_TIMEOUTx2; + if (IFS_info.Ink.cart_color == MIDTANK_8)//lubricant + { + timeout = CARTRIDGE_INK_TIMEOUT*3; + secondtimeout = CARTRIDGE_INK_TIMEOUTx2 * 3; + } /*** first TimeOut ***/ - if (IFS_info.Ink.time_out == CARTRIDGE_INK_TIMEOUT) + if (IFS_info.Ink.time_out == timeout) { - ReportWithPackageFilter(WasteFilter,"------------ first IFS_info.Ink.time_out, close valves -----------------", __FILE__, __LINE__, (IFS_info.Ink.time_out * SECONDS_5), RpMessage, (int_MidTank_Pressure_1000), 0); + Report("------------ first IFS_info.Ink.time_out, close valves -----------------", __FILE__, __LINE__, (IFS_info.Ink.time_out * SECONDS_5), RpMessage, (int_MidTank_Pressure_1000), 0); //IFS_info.Ink.time_out = 0; //return IFS_info.event = IFS_Timeout; @@ -179,20 +188,21 @@ WHS_sensor CartridgeInkTimeOutCallBackFunction() // start timeout // close and open the correct valves - IFS_info.Ink.time_out = 0; + IFS_info.Ink.time_out = 0; MidTankValvesAction(Cartridge_MidTank_OFF); - IFS_info.Ink.time_out = CARTRIDGE_INK_TIMEOUT; + IFS_info.Ink.time_out = timeout; } - if (IFS_info.Ink.time_out == (CARTRIDGE_INK_TIMEOUT + 1)) //need to open the valve for second chance + if (IFS_info.Ink.time_out == (timeout + 1)) //need to open the valve for second chance { - ReportWithPackageFilter(WasteFilter,"------------ IFS_Timeout open valves for second timeout -----------------", __FILE__, __LINE__, (IFS_info.Ink.time_out * SECONDS_5), RpMessage, (int_MidTank_Pressure_1000), 0); + Report("------------ IFS_Timeout open valves for second timeout -----------------", __FILE__, __LINE__, (IFS_info.Ink.time_out * SECONDS_5), RpMessage, (int_MidTank_Pressure_1000), 0); MidTankValvesAction(Cartridge_MidTank_ON); + IFS_info.Ink.time_out = timeout; } - if (IFS_info.Ink.time_out >= (CARTRIDGE_INK_TIMEOUTx2 + 1)) + if (IFS_info.Ink.time_out >= (secondtimeout + 1)) { - ReportWithPackageFilter(WasteFilter,"------------ IFS_Timeout_Second_Time -----------------", __FILE__, __LINE__, (IFS_info.Ink.time_out * SECONDS_5), RpMessage, (int_MidTank_Pressure_1000), 0); + Report("------------ IFS_Timeout_Second_Time -----------------", __FILE__, __LINE__, (IFS_info.Ink.time_out * SECONDS_5), RpMessage, (int_MidTank_Pressure_1000), 0); IFS_info.Ink.time_out = 0; MidTankValvesAction(Cartridge_MidTank_OFF); WHS_info.event = IFS_Timeout_Second; diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index cdcecaa2a..19392c754 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -197,12 +197,18 @@ } else { - WHS_Set_SetPoint_Q_value(headairflow/2); - Turn_the_Blower_On();//Turn on with the Default_Voltage - if (BlowerCfg.heatingvoltage) - Control_Voltage_To_Blower(BlowerCfg.heatingvoltage); + if(Head_Type > HEAD_TYPE_SYLKO_WITHOUT_CARD) + { + WHS_Set_SetPoint_Q_value(headairflow/2); + } else - Control_Voltage_To_Blower(BlowerCfg.voltage-500); + { + Turn_the_Blower_On();//Turn on with the Default_Voltage + if (BlowerCfg.heatingvoltage) + Control_Voltage_To_Blower(BlowerCfg.heatingvoltage); + else + Control_Voltage_To_Blower(BlowerCfg.voltage-500); + } Control_Dryer_Fan(STOP,75);//use START or STOP, 0 - 100% LoadStages++; ThreadLoadStateMachine(LoadStages); diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index 9698f1ea3..41ef9e480 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -657,7 +657,7 @@ void ScrewTimerInterrupt(int ARG0) TimerDisable(Screw_timerBase, TIMER_A); } ROM_IntMasterEnable(); - //Report("ScrewsStartControlTimer direction,speed ", __FILE__,__LINE__,ScrewCurrentDirection, RpMessage, ScrewSpeed, 0); + //Report("ScrewsStartControlTimer time direction,speed ", __FILE__,msec_millisecondCounter,ScrewCurrentDirection, RpMessage, ScrewSpeed, 0); //MotorSetSpeed(HARDWARE_MOTOR_TYPE__MOTO_SCREW,ScrewSpeed); //Rotations+=0.03; diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c index eeec890e4..8089a3b29 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c @@ -216,10 +216,12 @@ uint32_t InitSequenceBlowerCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) HWControlId = 0xFF; else Report("Remove control callback failed",__FILE__,__LINE__,(int)HWControlId,RpWarning,(int)InitSequenceBlowerCallBackFunction,0); + Turn_the_Blower_On();//Turn on with the Default_Voltage if (BlowerCfg.heatingvoltage) Control_Voltage_To_Blower(BlowerCfg.heatingvoltage); else Control_Voltage_To_Blower(3000); + WHS_enable_control_loop(true); WHS_Set_SetPoint_Q_value(headairflow/2); AlarmHandlingSetAlarm (EVENT_TYPE__MACHINE_STATE_INITIAL_BLOWER_FAILED,OFF); //handle alarm detection and operation @@ -502,7 +504,8 @@ uint32_t InitSequenceWaitForCooler(void) } else { - SetMachineStatus(MACHINE_STATE__Error); //prevent job while waiting for the cooler + SetMachineState(MACHINE_STATE_WAIT_FOR_COOLER); + //SetMachineStatus(MACHINE_STATE__Error); //prevent job while waiting for the cooler Report("AddControlCallback INIT",__FILE__,__LINE__,(int)HWControlId,RpWarning,(int)InitStages,0); //cold reset, wait 2 minutes for cooler start // HWControlId = AddControlCallback("Init Cooler", InitSequenceWaitForCoolerCallBackFunction, 2*eOneMinute, TemplateDataReadCBFunction,0,0, 0 ); -- cgit v1.3.1 From 6cbdc8fc0b64068e07801ed2066fa5afd5c15378 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Tue, 12 May 2020 16:24:19 +0300 Subject: new protobuf applied --- .../Embedded_SW/Embedded/Communication/Container.c | 2 +- .../Communication/PMR/Common/MessageType.pb-c.h | 4 +- .../PMR/Diagnostics/DiagnosticsMonitors.pb-c.c | 45 ++++++++++++++++++++-- .../PMR/Diagnostics/DiagnosticsMonitors.pb-c.h | 8 +++- .../I2C_Communication/WHS_Card/EEPROM/WHS_EEPROM.c | 2 +- .../Embedded/Modules/Diagnostics/Diagnostics.c | 22 +++++------ 6 files changed, 63 insertions(+), 20 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Communication/Container.c b/Software/Embedded_SW/Embedded/Communication/Container.c index 090609748..648e0a628 100644 --- a/Software/Embedded_SW/Embedded/Communication/Container.c +++ b/Software/Embedded_SW/Embedded/Communication/Container.c @@ -497,7 +497,7 @@ void receive_callback(char* buffer, size_t length) case MESSAGE_TYPE__StubDispenserEEpromRequest: StubDispenserEEpromRequestFunc(requestContainer); break; - case MESSAGE_TYPE__StubWHSEEpromRequest: + case MESSAGE_TYPE__StubWhsEEpromRequest: WhsEEpromRequestFunc(requestContainer); break; default: 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 236d9dfdd..a8d8d9af0 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 @@ -126,8 +126,8 @@ typedef enum _MessageType { MESSAGE_TYPE__StubMidTankPressureSensorResponse = 104, MESSAGE_TYPE__StubDispenserEEpromRequest = 105, MESSAGE_TYPE__StubDispenserEEpromResponse = 106, - MESSAGE_TYPE__StubWHSEEpromRequest = 107, - MESSAGE_TYPE__StubWHSEEpromResponse = 108, + MESSAGE_TYPE__StubWhsEEpromRequest = 107, + MESSAGE_TYPE__StubWhsEEpromResponse = 108, MESSAGE_TYPE__ExternalBridgeUdpDiscoveryPacket = 1000, MESSAGE_TYPE__ExternalBridgeLoginRequest = 1001, MESSAGE_TYPE__ExternalBridgeLoginResponse = 1002, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DiagnosticsMonitors.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DiagnosticsMonitors.pb-c.c index bf37bfed9..f8b36e663 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DiagnosticsMonitors.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DiagnosticsMonitors.pb-c.c @@ -52,7 +52,7 @@ void diagnostics_monitors__free_unpacked assert(message->base.descriptor == &diagnostics_monitors__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -static const ProtobufCFieldDescriptor diagnostics_monitors__field_descriptors[85] = +static const ProtobufCFieldDescriptor diagnostics_monitors__field_descriptors[88] = { { "", @@ -1074,6 +1074,42 @@ static const ProtobufCFieldDescriptor diagnostics_monitors__field_descriptors[85 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, + { + "", + 86, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(DiagnosticsMonitors, n_gassensor), + offsetof(DiagnosticsMonitors, gassensor), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 87, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(DiagnosticsMonitors, n_incomingvoltage), + offsetof(DiagnosticsMonitors, incomingvoltage), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 88, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(DiagnosticsMonitors, n_wastelevel), + offsetof(DiagnosticsMonitors, wastelevel), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, }; static const unsigned diagnostics_monitors__field_indices_by_name[] = { 38, /* field[38] = BlowerVoltage */ @@ -1112,6 +1148,7 @@ static const unsigned diagnostics_monitors__field_indices_by_name[] = { 3, /* field[3] = FeederMotorFrequency */ 14, /* field[14] = FeederTension */ 25, /* field[25] = FilterDeltaPressure */ + 85, /* field[85] = GasSensor */ 13, /* field[13] = HeadAirFlow */ 78, /* field[78] = HeadBlowerVoltage1 */ 79, /* field[79] = HeadBlowerVoltage2 */ @@ -1142,6 +1179,7 @@ static const unsigned diagnostics_monitors__field_indices_by_name[] = { 69, /* field[69] = HeadZone8Temperature */ 70, /* field[70] = HeadZone9HeaterCurrent */ 71, /* field[71] = HeadZone9Temperature */ + 86, /* field[86] = IncomingVoltage */ 47, /* field[47] = MidTank1Level */ 48, /* field[48] = MidTank2Level */ 49, /* field[49] = MidTank3Level */ @@ -1159,13 +1197,14 @@ static const unsigned diagnostics_monitors__field_indices_by_name[] = { 7, /* field[7] = ScrewMotor */ 8, /* field[8] = ThreadSpeed */ 84, /* field[84] = WHSBlower2Voltage */ + 87, /* field[87] = WasteLevel */ 6, /* field[6] = WinderMotor */ 20, /* field[20] = WinderTension */ }; static const ProtobufCIntRange diagnostics_monitors__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 85 } + { 0, 88 } }; const ProtobufCMessageDescriptor diagnostics_monitors__descriptor = { @@ -1175,7 +1214,7 @@ const ProtobufCMessageDescriptor diagnostics_monitors__descriptor = "", "", sizeof(DiagnosticsMonitors), - 85, + 88, diagnostics_monitors__field_descriptors, diagnostics_monitors__field_indices_by_name, 1, diagnostics_monitors__number_ranges, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DiagnosticsMonitors.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DiagnosticsMonitors.pb-c.h index 38ee1ce97..172fb5e24 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DiagnosticsMonitors.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/DiagnosticsMonitors.pb-c.h @@ -197,10 +197,16 @@ struct _DiagnosticsMonitors double *headcoverheater2temperature; size_t n_whsblower2voltage; double *whsblower2voltage; + size_t n_gassensor; + double *gassensor; + size_t n_incomingvoltage; + double *incomingvoltage; + size_t n_wastelevel; + double *wastelevel; }; #define DIAGNOSTICS_MONITORS__INIT \ { PROTOBUF_C_MESSAGE_INIT (&diagnostics_monitors__descriptor) \ - , 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL } + , 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL } /* DiagnosticsMonitors methods */ diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/EEPROM/WHS_EEPROM.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/EEPROM/WHS_EEPROM.c index 8e628674a..2e35ce558 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/EEPROM/WHS_EEPROM.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/EEPROM/WHS_EEPROM.c @@ -353,7 +353,7 @@ uint32_t WhsEEpromRequestFunc(MessageContainer* requestContainer) { Cresponse.whseeprom = WhsEEpromInstance; } - responseContainer = createContainer(MESSAGE_TYPE__StubWHSEEpromResponse, requestContainer->token, true, &Cresponse, &stub_whs_eeprom_response__pack, &stub_whs_eeprom_response__get_packed_size); + responseContainer = createContainer(MESSAGE_TYPE__StubWhsEEpromResponse, requestContainer->token, true, &Cresponse, &stub_whs_eeprom_response__pack, &stub_whs_eeprom_response__get_packed_size); responseContainer.continuous = false; if (status != OK) { diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index 1390e23e0..7758ebd8b 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -669,6 +669,8 @@ void DiagnosticOneMinuteCollection(void) VOC_Sensor = (double) getGasReading(); DiagnosticsMonitor.n_filterdeltapressure = 1; DiagnosticsMonitor.filterdeltapressure = &VOC_Sensor; + DiagnosticsMonitor.n_gassensor = 1; + DiagnosticsMonitor.gassensor = &VOC_Sensor; DiagnosticsMonitor.n_blowervoltage = 1; diagvoltage = getBlowerState(); @@ -687,16 +689,6 @@ void DiagnosticOneMinuteCollection(void) DiagnosticsMonitor.n_headairflow = 1; DiagnosticsMonitor.headairflow = &HeadFlowMeter; -/* if (Head_Type > HEAD_TYPE_SYLKO_WITHOUT_CARD) //rapid/pp machines - { - AcVoltage = ReadVAC(); - DiagnosticsMonitor.whsblower2voltage = &AcVoltage; - DiagnosticsMonitor.n_whsblower2voltage = 1; - } -*/ - - - } void DiaglosticChangeBlowerData() { @@ -714,6 +706,8 @@ void DiagnosticOneSecCollection(void) AcVoltage = ReadVAC(); DiagnosticsMonitor.whsblower2voltage = &AcVoltage; DiagnosticsMonitor.n_whsblower2voltage = 1; + DiagnosticsMonitor.incomingvoltage = &AcVoltage; + DiagnosticsMonitor.n_incomingvoltage = 1; } if (WHS_Type == WHS_TYPE_NEW) //rapid/pp machines { @@ -729,10 +723,12 @@ void DiagnosticOneSecCollection(void) Report("Head flow change 1s",__FILE__,(int)diagvoltage,(int)(tempFlow*1000),RpWarning,(int)(HeadFlowMeter*1000),0); tempFlow = HeadFlowMeter; } - DiagnosticsMonitor.n_chillertemperature = 1; WasteLevel = GetWHSWasteTankLevelMiliLiter(); + DiagnosticsMonitor.n_chillertemperature = 1; DiagnosticsMonitor.chillertemperature = &WasteLevel; - } + DiagnosticsMonitor.n_wastelevel = 1; + DiagnosticsMonitor.wastelevel = &WasteLevel; + } HeatersCurrent[HEATER_DRYER_CURRENT_1][0] = Get_Heaters_Current(HEATER_DRYER_CURRENT_1); HeatersCurrent[HEATER_DRYER_CURRENT_2][0] = Get_Heaters_Current(HEATER_DRYER_CURRENT_2); DiagnosticsMonitor.n_drierzone1heatercurrent = 1; @@ -1075,6 +1071,8 @@ void SendDiagnostics(void) VOC_Sensor = (double) getGasReading(); DiagnosticsMonitor.n_filterdeltapressure = 1; DiagnosticsMonitor.filterdeltapressure = &VOC_Sensor; + DiagnosticsMonitor.n_gassensor = 1; + DiagnosticsMonitor.gassensor = &VOC_Sensor; response.monitors = &DiagnosticsMonitor; //response.digitalpins = DigitalPinArray; -- cgit v1.3.1