From 58fdc1c4c02d1df6a1d58729308b7be515982844 Mon Sep 17 00:00:00 2001 From: Avi Levkovich Date: Wed, 30 Sep 2020 14:26:20 +0300 Subject: Reading VOC gas sensor only when using new whs --- Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Control') diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index 765712502..5f1c0ffaf 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -827,7 +827,10 @@ uint32_t MillisecLowLoop(uint32_t tick) Gas_PPM_Info = Calculate_Gas_Power_Consumption();*/ // ReportWithPackageFilter(ThreadFilter,"waste tank calculate level",__FILE__,__LINE__,(int)(GetWHSWasteTankLevelMiliLiter()*1000),RpWarning,(int) msec_millisecondCounter,0); //Trigger_WHS_MAX11614_Read_allADC(); - Trigger_WHS_MAX11614_Read_Gas_Sensor(); + if (WHS_Type == WHS_TYPE_NEW) + { + Trigger_WHS_MAX11614_Read_Gas_Sensor(); + } #ifdef CONTROL_DEBUG ResetControlTime(); #endif -- cgit v1.3.1 From cae0bfc060f16dd75661ebba88d3c905dd2ac875 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 7 Oct 2020 13:14:49 +0300 Subject: Head EEPROM stubs, pressurer sensor 2 read (WHS), --- .../PMR/Stubs/StubHeadEEpromData.pb-c.c | 664 +++++++++++++++++++++ .../PMR/Stubs/StubHeadEEpromData.pb-c.h | 150 +++++ .../PMR/Stubs/StubHeadEEpromRequest.pb-c.c | 105 ++++ .../PMR/Stubs/StubHeadEEpromRequest.pb-c.h | 74 +++ .../PMR/Stubs/StubHeadEEpromResponse.pb-c.c | 92 +++ .../PMR/Stubs/StubHeadEEpromResponse.pb-c.h | 72 +++ .../WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c | 12 +- .../WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.h | 2 +- .../Embedded/Modules/Control/MillisecTask.c | 1 + .../Embedded/Modules/Diagnostics/Diagnostics.c | 7 +- .../Embedded/Modules/Heaters/Heaters_print.c | 2 +- .../Embedded/Modules/Stubs_Handler/Progress.c | 3 + .../StateMachines/Initialization/InitSequence.c | 15 +- 13 files changed, 1186 insertions(+), 13 deletions(-) create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubHeadEEpromData.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubHeadEEpromData.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubHeadEEpromRequest.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubHeadEEpromRequest.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubHeadEEpromResponse.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubHeadEEpromResponse.pb-c.h (limited to 'Software/Embedded_SW/Embedded/Modules/Control') diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubHeadEEpromData.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubHeadEEpromData.pb-c.c new file mode 100644 index 000000000..1c882a404 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubHeadEEpromData.pb-c.c @@ -0,0 +1,664 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubHeadEEpromData.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubHeadEEpromData.pb-c.h" +void stub_head_eeprom_data__init + (StubHeadEEpromData *message) +{ + static const StubHeadEEpromData init_value = STUB_HEAD_EEPROM_DATA__INIT; + *message = init_value; +} +size_t stub_head_eeprom_data__get_packed_size + (const StubHeadEEpromData *message) +{ + assert(message->base.descriptor == &stub_head_eeprom_data__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_head_eeprom_data__pack + (const StubHeadEEpromData *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_head_eeprom_data__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_head_eeprom_data__pack_to_buffer + (const StubHeadEEpromData *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_head_eeprom_data__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubHeadEEpromData * + stub_head_eeprom_data__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubHeadEEpromData *) + protobuf_c_message_unpack (&stub_head_eeprom_data__descriptor, + allocator, len, data); +} +void stub_head_eeprom_data__free_unpacked + (StubHeadEEpromData *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_head_eeprom_data__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_head_eeprom_data__field_descriptors[45] = +{ + { + "", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_header), + offsetof(StubHeadEEpromData, header), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_table_length), + offsetof(StubHeadEEpromData, table_length), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_table_version), + offsetof(StubHeadEEpromData, table_version), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(StubHeadEEpromData, head_sn), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(StubHeadEEpromData, pcb_sn), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 6, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(StubHeadEEpromData, head_part_number), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 7, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(StubHeadEEpromData, pcb_part_number), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 8, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_runninghours), + offsetof(StubHeadEEpromData, runninghours), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 9, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_sw_reserve), + offsetof(StubHeadEEpromData, sw_reserve), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 10, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(StubHeadEEpromData, testpassfail), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 11, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_ats_location), + offsetof(StubHeadEEpromData, ats_location), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 12, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(StubHeadEEpromData, has_orifice_waste_level_v0_ml), + offsetof(StubHeadEEpromData, orifice_waste_level_v0_ml), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 13, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_headtype), + offsetof(StubHeadEEpromData, headtype), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 14, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_blowerrunhours1), + offsetof(StubHeadEEpromData, blowerrunhours1), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 15, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_blowerrunhours2), + offsetof(StubHeadEEpromData, blowerrunhours2), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 16, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_fanfiltermaxlifecycle), + offsetof(StubHeadEEpromData, fanfiltermaxlifecycle), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 17, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_fansfilterusagehours), + offsetof(StubHeadEEpromData, fansfilterusagehours), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 18, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_filterspare1), + offsetof(StubHeadEEpromData, filterspare1), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 19, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_filterspare2), + offsetof(StubHeadEEpromData, filterspare2), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 20, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_benchtestd), + offsetof(StubHeadEEpromData, benchtestd), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 21, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_spare1), + offsetof(StubHeadEEpromData, spare1), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 22, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_spare2), + offsetof(StubHeadEEpromData, spare2), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 23, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(StubHeadEEpromData, productiontestdate), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 24, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_functeststatus), + offsetof(StubHeadEEpromData, functeststatus), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 25, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(StubHeadEEpromData, pressenspcb_sn), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 26, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(StubHeadEEpromData, pressenspcb_pn), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 27, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(StubHeadEEpromData, presscalibdate1), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 28, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_presswithoutblower_mv1), + offsetof(StubHeadEEpromData, presswithoutblower_mv1), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 29, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_presswithminblower_mv1), + offsetof(StubHeadEEpromData, presswithminblower_mv1), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 30, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_pressmaxpress_mv1), + offsetof(StubHeadEEpromData, pressmaxpress_mv1), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 31, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(StubHeadEEpromData, presscalibdate2), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 32, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_presswithoutblower_mv2), + offsetof(StubHeadEEpromData, presswithoutblower_mv2), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 33, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_presswithminblower_mv2), + offsetof(StubHeadEEpromData, presswithminblower_mv2), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 34, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_pressmaxpress_mv2), + offsetof(StubHeadEEpromData, pressmaxpress_mv2), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 35, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_fansminpwm), + offsetof(StubHeadEEpromData, fansminpwm), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 36, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_fansminrpm), + offsetof(StubHeadEEpromData, fansminrpm), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 37, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_fansmaxpwm), + offsetof(StubHeadEEpromData, fansmaxpwm), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 38, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_fansmaxrpm), + offsetof(StubHeadEEpromData, fansmaxrpm), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 39, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_fansnompwm), + offsetof(StubHeadEEpromData, fansnompwm), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 40, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_fansnomrpm), + offsetof(StubHeadEEpromData, fansnomrpm), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 41, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_fanslimitrpm), + offsetof(StubHeadEEpromData, fanslimitrpm), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 42, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_fanstachoppr), + offsetof(StubHeadEEpromData, fanstachoppr), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 43, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_fansspare1), + offsetof(StubHeadEEpromData, fansspare1), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 44, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_fansspare2), + offsetof(StubHeadEEpromData, fansspare2), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 45, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHeadEEpromData, has_checksum), + offsetof(StubHeadEEpromData, checksum), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_head_eeprom_data__field_indices_by_name[] = { + 10, /* field[10] = ATS_Location */ + 19, /* field[19] = BenchTestD */ + 13, /* field[13] = BlowerRunHours1 */ + 14, /* field[14] = BlowerRunHours2 */ + 44, /* field[44] = CheckSum */ + 15, /* field[15] = FanFilterMaxLifecycle */ + 16, /* field[16] = FansFilterUsageHours */ + 40, /* field[40] = FansLimitRPM */ + 36, /* field[36] = FansMaxPWM */ + 37, /* field[37] = FansMaxRPM */ + 34, /* field[34] = FansMinPWM */ + 35, /* field[35] = FansMinRPM */ + 38, /* field[38] = FansNomPWM */ + 39, /* field[39] = FansNomRPM */ + 42, /* field[42] = FansSpare1 */ + 43, /* field[43] = FansSpare2 */ + 41, /* field[41] = FansTachoPPR */ + 17, /* field[17] = FilterSpare1 */ + 18, /* field[18] = FilterSpare2 */ + 23, /* field[23] = FuncTestStatus */ + 12, /* field[12] = HeadType */ + 5, /* field[5] = Head_Part_Number */ + 3, /* field[3] = Head_SN */ + 0, /* field[0] = Header */ + 11, /* field[11] = Orifice_Waste_Level_V0_ml */ + 6, /* field[6] = PCB_Part_Number */ + 4, /* field[4] = PCB_SN */ + 25, /* field[25] = PresSensPCB_PN */ + 24, /* field[24] = PresSensPCB_SN */ + 26, /* field[26] = PressCalibDate1 */ + 30, /* field[30] = PressCalibDate2 */ + 29, /* field[29] = PressMaxPress_mV1 */ + 33, /* field[33] = PressMaxPress_mV2 */ + 28, /* field[28] = PressWithMinBlower_mV1 */ + 32, /* field[32] = PressWithMinBlower_mV2 */ + 27, /* field[27] = PressWithoutBlower_mV1 */ + 31, /* field[31] = PressWithoutBlower_mV2 */ + 22, /* field[22] = ProductionTestDate */ + 7, /* field[7] = RunningHours */ + 8, /* field[8] = SW_Reserve */ + 20, /* field[20] = Spare1 */ + 21, /* field[21] = Spare2 */ + 1, /* field[1] = Table_Length */ + 2, /* field[2] = Table_version */ + 9, /* field[9] = TestPassFail */ +}; +static const ProtobufCIntRange stub_head_eeprom_data__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 45 } +}; +const ProtobufCMessageDescriptor stub_head_eeprom_data__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "", + "", + "", + "", + sizeof(StubHeadEEpromData), + 45, + stub_head_eeprom_data__field_descriptors, + stub_head_eeprom_data__field_indices_by_name, + 1, stub_head_eeprom_data__number_ranges, + (ProtobufCMessageInit) stub_head_eeprom_data__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubHeadEEpromData.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubHeadEEpromData.pb-c.h new file mode 100644 index 000000000..051bd3f7a --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubHeadEEpromData.pb-c.h @@ -0,0 +1,150 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubHeadEEpromData.proto */ + +#ifndef PROTOBUF_C_StubHeadEEpromData_2eproto__INCLUDED +#define PROTOBUF_C_StubHeadEEpromData_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 _StubHeadEEpromData StubHeadEEpromData; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubHeadEEpromData +{ + ProtobufCMessage base; + protobuf_c_boolean has_header; + uint32_t header; + protobuf_c_boolean has_table_length; + uint32_t table_length; + protobuf_c_boolean has_table_version; + uint32_t table_version; + char *head_sn; + char *pcb_sn; + char *head_part_number; + char *pcb_part_number; + protobuf_c_boolean has_runninghours; + uint32_t runninghours; + protobuf_c_boolean has_sw_reserve; + uint32_t sw_reserve; + char *testpassfail; + protobuf_c_boolean has_ats_location; + uint32_t ats_location; + protobuf_c_boolean has_orifice_waste_level_v0_ml; + double orifice_waste_level_v0_ml; + protobuf_c_boolean has_headtype; + uint32_t headtype; + protobuf_c_boolean has_blowerrunhours1; + uint32_t blowerrunhours1; + protobuf_c_boolean has_blowerrunhours2; + uint32_t blowerrunhours2; + protobuf_c_boolean has_fanfiltermaxlifecycle; + uint32_t fanfiltermaxlifecycle; + protobuf_c_boolean has_fansfilterusagehours; + uint32_t fansfilterusagehours; + protobuf_c_boolean has_filterspare1; + uint32_t filterspare1; + protobuf_c_boolean has_filterspare2; + uint32_t filterspare2; + protobuf_c_boolean has_benchtestd; + uint32_t benchtestd; + protobuf_c_boolean has_spare1; + uint32_t spare1; + protobuf_c_boolean has_spare2; + uint32_t spare2; + char *productiontestdate; + protobuf_c_boolean has_functeststatus; + uint32_t functeststatus; + char *pressenspcb_sn; + char *pressenspcb_pn; + char *presscalibdate1; + protobuf_c_boolean has_presswithoutblower_mv1; + uint32_t presswithoutblower_mv1; + protobuf_c_boolean has_presswithminblower_mv1; + uint32_t presswithminblower_mv1; + protobuf_c_boolean has_pressmaxpress_mv1; + uint32_t pressmaxpress_mv1; + char *presscalibdate2; + protobuf_c_boolean has_presswithoutblower_mv2; + uint32_t presswithoutblower_mv2; + protobuf_c_boolean has_presswithminblower_mv2; + uint32_t presswithminblower_mv2; + protobuf_c_boolean has_pressmaxpress_mv2; + uint32_t pressmaxpress_mv2; + protobuf_c_boolean has_fansminpwm; + uint32_t fansminpwm; + protobuf_c_boolean has_fansminrpm; + uint32_t fansminrpm; + protobuf_c_boolean has_fansmaxpwm; + uint32_t fansmaxpwm; + protobuf_c_boolean has_fansmaxrpm; + uint32_t fansmaxrpm; + protobuf_c_boolean has_fansnompwm; + uint32_t fansnompwm; + protobuf_c_boolean has_fansnomrpm; + uint32_t fansnomrpm; + protobuf_c_boolean has_fanslimitrpm; + uint32_t fanslimitrpm; + protobuf_c_boolean has_fanstachoppr; + uint32_t fanstachoppr; + protobuf_c_boolean has_fansspare1; + uint32_t fansspare1; + protobuf_c_boolean has_fansspare2; + uint32_t fansspare2; + protobuf_c_boolean has_checksum; + uint32_t checksum; +}; +#define STUB_HEAD_EEPROM_DATA__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_head_eeprom_data__descriptor) \ + , 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + + +/* StubHeadEEpromData methods */ +void stub_head_eeprom_data__init + (StubHeadEEpromData *message); +size_t stub_head_eeprom_data__get_packed_size + (const StubHeadEEpromData *message); +size_t stub_head_eeprom_data__pack + (const StubHeadEEpromData *message, + uint8_t *out); +size_t stub_head_eeprom_data__pack_to_buffer + (const StubHeadEEpromData *message, + ProtobufCBuffer *buffer); +StubHeadEEpromData * + stub_head_eeprom_data__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_head_eeprom_data__free_unpacked + (StubHeadEEpromData *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubHeadEEpromData_Closure) + (const StubHeadEEpromData *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_head_eeprom_data__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubHeadEEpromData_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubHeadEEpromRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubHeadEEpromRequest.pb-c.c new file mode 100644 index 000000000..5df62b580 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubHeadEEpromRequest.pb-c.c @@ -0,0 +1,105 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubHeadEEpromRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubHeadEEpromRequest.pb-c.h" +void stub_head_eeprom_request__init + (StubHeadEEpromRequest *message) +{ + static const StubHeadEEpromRequest init_value = STUB_HEAD_EEPROM_REQUEST__INIT; + *message = init_value; +} +size_t stub_head_eeprom_request__get_packed_size + (const StubHeadEEpromRequest *message) +{ + assert(message->base.descriptor == &stub_head_eeprom_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_head_eeprom_request__pack + (const StubHeadEEpromRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_head_eeprom_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_head_eeprom_request__pack_to_buffer + (const StubHeadEEpromRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_head_eeprom_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubHeadEEpromRequest * + stub_head_eeprom_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubHeadEEpromRequest *) + protobuf_c_message_unpack (&stub_head_eeprom_request__descriptor, + allocator, len, data); +} +void stub_head_eeprom_request__free_unpacked + (StubHeadEEpromRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_head_eeprom_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_head_eeprom_request__field_descriptors[2] = +{ + { + "", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubHeadEEpromRequest, has_burnrequest), + offsetof(StubHeadEEpromRequest, burnrequest), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(StubHeadEEpromRequest, headeeprom), + &stub_head_eeprom_data__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_head_eeprom_request__field_indices_by_name[] = { + 0, /* field[0] = BurnRequest */ + 1, /* field[1] = HeadEEprom */ +}; +static const ProtobufCIntRange stub_head_eeprom_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor stub_head_eeprom_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "", + "", + "", + "", + sizeof(StubHeadEEpromRequest), + 2, + stub_head_eeprom_request__field_descriptors, + stub_head_eeprom_request__field_indices_by_name, + 1, stub_head_eeprom_request__number_ranges, + (ProtobufCMessageInit) stub_head_eeprom_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubHeadEEpromRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubHeadEEpromRequest.pb-c.h new file mode 100644 index 000000000..e7f34ada1 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubHeadEEpromRequest.pb-c.h @@ -0,0 +1,74 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubHeadEEpromRequest.proto */ + +#ifndef PROTOBUF_C_StubHeadEEpromRequest_2eproto__INCLUDED +#define PROTOBUF_C_StubHeadEEpromRequest_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 "StubHeadEEpromData.pb-c.h" + +typedef struct _StubHeadEEpromRequest StubHeadEEpromRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubHeadEEpromRequest +{ + ProtobufCMessage base; + protobuf_c_boolean has_burnrequest; + protobuf_c_boolean burnrequest; + StubHeadEEpromData *headeeprom; +}; +#define STUB_HEAD_EEPROM_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_head_eeprom_request__descriptor) \ + , 0, 0, NULL } + + +/* StubHeadEEpromRequest methods */ +void stub_head_eeprom_request__init + (StubHeadEEpromRequest *message); +size_t stub_head_eeprom_request__get_packed_size + (const StubHeadEEpromRequest *message); +size_t stub_head_eeprom_request__pack + (const StubHeadEEpromRequest *message, + uint8_t *out); +size_t stub_head_eeprom_request__pack_to_buffer + (const StubHeadEEpromRequest *message, + ProtobufCBuffer *buffer); +StubHeadEEpromRequest * + stub_head_eeprom_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_head_eeprom_request__free_unpacked + (StubHeadEEpromRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubHeadEEpromRequest_Closure) + (const StubHeadEEpromRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_head_eeprom_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubHeadEEpromRequest_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubHeadEEpromResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubHeadEEpromResponse.pb-c.c new file mode 100644 index 000000000..fd912179f --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubHeadEEpromResponse.pb-c.c @@ -0,0 +1,92 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubHeadEEpromResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubHeadEEpromResponse.pb-c.h" +void stub_head_eeprom_response__init + (StubHeadEEpromResponse *message) +{ + static const StubHeadEEpromResponse init_value = STUB_HEAD_EEPROM_RESPONSE__INIT; + *message = init_value; +} +size_t stub_head_eeprom_response__get_packed_size + (const StubHeadEEpromResponse *message) +{ + assert(message->base.descriptor == &stub_head_eeprom_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_head_eeprom_response__pack + (const StubHeadEEpromResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_head_eeprom_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_head_eeprom_response__pack_to_buffer + (const StubHeadEEpromResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_head_eeprom_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubHeadEEpromResponse * + stub_head_eeprom_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubHeadEEpromResponse *) + protobuf_c_message_unpack (&stub_head_eeprom_response__descriptor, + allocator, len, data); +} +void stub_head_eeprom_response__free_unpacked + (StubHeadEEpromResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_head_eeprom_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_head_eeprom_response__field_descriptors[1] = +{ + { + "", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(StubHeadEEpromResponse, headeeprom), + &stub_head_eeprom_data__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_head_eeprom_response__field_indices_by_name[] = { + 0, /* field[0] = HeadEEprom */ +}; +static const ProtobufCIntRange stub_head_eeprom_response__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor stub_head_eeprom_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "", + "", + "", + "", + sizeof(StubHeadEEpromResponse), + 1, + stub_head_eeprom_response__field_descriptors, + stub_head_eeprom_response__field_indices_by_name, + 1, stub_head_eeprom_response__number_ranges, + (ProtobufCMessageInit) stub_head_eeprom_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubHeadEEpromResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubHeadEEpromResponse.pb-c.h new file mode 100644 index 000000000..e041cbb8a --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubHeadEEpromResponse.pb-c.h @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubHeadEEpromResponse.proto */ + +#ifndef PROTOBUF_C_StubHeadEEpromResponse_2eproto__INCLUDED +#define PROTOBUF_C_StubHeadEEpromResponse_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 "StubHeadEEpromData.pb-c.h" + +typedef struct _StubHeadEEpromResponse StubHeadEEpromResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubHeadEEpromResponse +{ + ProtobufCMessage base; + StubHeadEEpromData *headeeprom; +}; +#define STUB_HEAD_EEPROM_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_head_eeprom_response__descriptor) \ + , NULL } + + +/* StubHeadEEpromResponse methods */ +void stub_head_eeprom_response__init + (StubHeadEEpromResponse *message); +size_t stub_head_eeprom_response__get_packed_size + (const StubHeadEEpromResponse *message); +size_t stub_head_eeprom_response__pack + (const StubHeadEEpromResponse *message, + uint8_t *out); +size_t stub_head_eeprom_response__pack_to_buffer + (const StubHeadEEpromResponse *message, + ProtobufCBuffer *buffer); +StubHeadEEpromResponse * + stub_head_eeprom_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_head_eeprom_response__free_unpacked + (StubHeadEEpromResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubHeadEEpromResponse_Closure) + (const StubHeadEEpromResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_head_eeprom_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubHeadEEpromResponse_2eproto__INCLUDED */ 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 bb41e1af3..f7253a2e2 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 @@ -64,12 +64,13 @@ uint32_t WHS_MAX11614_Init () } -uint32_t WHS_MAX11614_Load_OrificeZeroValue (uint16_t O1, uint16_t O3) +uint32_t WHS_MAX11614_Load_OrificeZeroValue (uint16_t O1, uint16_t O2, uint16_t O3) { Orf_zero_value[HEAD_FLOW_METER] = O1; - Orf_zero_value[DRIER_FLOW_METER] = O3; - ReportWithPackageFilter(InitFilter,"WHS_MAX11614_Load_OrificeZeroValue", __FILE__,__LINE__,Orf_zero_value[HEAD_FLOW_METER], RpMessage, Orf_zero_value[DRIER_FLOW_METER], 0); + Orf_zero_value[NU_FLOW_METER] = O2; + Orf_zero_value[DRIER_FLOW_METER] = O3; + ReportWithPackageFilter(InitFilter,"WHS_MAX11614_Load_OrificeZeroValue", __FILE__,Orf_zero_value[NU_FLOW_METER],Orf_zero_value[HEAD_FLOW_METER], RpMessage, Orf_zero_value[DRIER_FLOW_METER], 0); return OK; } @@ -236,7 +237,10 @@ double get_Q(WHS_Flow_Meter num) get_orf_3(&Vm); V0 = Orf_zero_value[DRIER_FLOW_METER]; break; - + case NU_FLOW_METER: + get_orf_2(&Vm); + V0 = Orf_zero_value[NU_FLOW_METER]; + break; case HEAD_FLOW_METER: get_orf_1(&Vm); V0 = Orf_zero_value[HEAD_FLOW_METER]; diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.h index 5bf85fb6b..283fe8d98 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.h +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.h @@ -80,7 +80,7 @@ double GetWHSWasteTankLevelMiliLiter(); bool SetDisplayView(WHS_Display_View view ); bool SetLeftDisplayView(WHS_Left_Display_View view ); bool SetWriteDisplayView(WHS_Left_Display_View view ); -uint32_t WHS_MAX11614_Load_OrificeZeroValue (uint16_t O1, uint16_t O3); +uint32_t WHS_MAX11614_Load_OrificeZeroValue (uint16_t O1,uint16_t O2, uint16_t O3); uint16_t Get_orf1_V0(void); uint16_t Get_orf3_V0(void); diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index 5f1c0ffaf..dd885b6af 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -777,6 +777,7 @@ uint32_t MillisecLowLoop(uint32_t tick) { //Trigger_WHS_PT100_Read_All(); WHS_Blower_Avarege(HEAD_FLOW_METER); + WHS_Blower_Avarege(NU_FLOW_METER); WHS_Blower_Avarege(DRIER_FLOW_METER); WHS_Start_Blower_Control_Closed_Loop (); diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index 537f942b6..16010b908 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -117,7 +117,7 @@ double dispenserspressure[MAX_SYSTEM_DISPENSERS][DIAGNOSTICS_LIMIT+1]; double dispenserinklevel[MAX_SYSTEM_DISPENSERS][1]; double midtankinklevel[MAX_SYSTEM_DISPENSERS][1]; double MidTankpressure[MAX_SYSTEM_DISPENSERS][1]; -double HeadFlowMeter; +double HeadFlowMeter,TotalFlowMeter; //double tempFlow = 0.0; double DrierFlowMeter; double AcVoltage; @@ -897,6 +897,11 @@ void DiagnosticOneSecCollection(void) HeadFlowMeter = GetWHSAirFlow(HEAD_FLOW_METER); DiagnosticsMonitor.n_headairflow = 1; DiagnosticsMonitor.headairflow = &HeadFlowMeter; + + TotalFlowMeter = GetWHSAirFlow(NU_FLOW_METER); + DiagnosticsMonitor.n_totalwhsflow = 1; + DiagnosticsMonitor.totalwhsflow = &TotalFlowMeter; + /*if (fabs(tempFlow - HeadFlowMeter)>0.25) { Report("Head flow change 1s",__FILE__,(int)diagvoltage,(int)(tempFlow*1000),RpWarning,(int)(HeadFlowMeter*1000),0); diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index 6814d5903..0fe6f6b04 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -1187,7 +1187,7 @@ uint32_t HeaterBlowerMaxTempCBFunction(uint32_t IfIndex, uint32_t readValue) //ReportWithPackageFilter(HeatersFilter,(MinreadValue/100), "Heater Over the max temperature, turned off"); return OK; } - if (MaxreadValue <= (HeaterControl[index].sensormaxvalue-HeaterControl[index].sensorminvalue)) //was MinreadValue + if (BlowerPt100Read <= (HeaterControl[index].sensormaxvalue-HeaterControl[index].sensorminvalue)) //was MinreadValue { if (HeaterControl[index].sensorminvalue > 0) { diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c index b23985103..e4a573e7b 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c @@ -398,6 +398,9 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) case 10: temp_double = get_Q(HEAD_FLOW_METER); break; + case 11: + temp_double = get_Q(NU_FLOW_METER); + break; case 12: temp_double = get_Q(DRIER_FLOW_METER); break; diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c index e543bf2a1..92d6d586b 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c @@ -430,7 +430,7 @@ uint32_t InitSequencePowerManagementInit(void) uint32_t InitSequenceInitialBlowerActivation(void) { SetMachineState(MACHINE_STATE_INITIAL_BLOWER_ACTIVATION); - int i,total1=0,total3=0; + int i,total1=0,total2=0,total3=0; uint32_t ZeroValue; uint16_t value = 0; //WHS_Start_Blower_Control_Closed_Loop(0.0); @@ -447,12 +447,15 @@ uint32_t InitSequenceInitialBlowerActivation(void) { get_orf_1(&value); total1+=value; + get_orf_2(&value); + total2+=value; get_orf_3(&value); total3+=value; - ReportWithPackageFilter(InitFilter,"load initial orifice value", __FILE__,i,total1, RpMessage, total3, 0); + ReportWithPackageFilter(InitFilter,"load initial orifice value", __FILE__,total1,total2, RpMessage, total3, 0); Task_sleep(100); } total1/=8; + total2/=8; total3/=8; MCU_E2PromRead(EEPROM_ORIFICE1_ZERO_VALUE,&ZeroValue); if ((total1>800)&&(total1<2000)) @@ -470,14 +473,14 @@ uint32_t InitSequenceInitialBlowerActivation(void) else total3 = ZeroValue; ReportWithPackageFilter(InitFilter,"store initial orifice 3 value", __FILE__,EEPROM_ORIFICE3_ZERO_VALUE,total3, RpMessage, ZeroValue, 0); - WHS_MAX11614_Load_OrificeZeroValue(total1,total3); + WHS_MAX11614_Load_OrificeZeroValue(total1,total3,total3); } else { MCU_E2PromRead(EEPROM_ORIFICE1_ZERO_VALUE,&total1); MCU_E2PromRead(EEPROM_ORIFICE3_ZERO_VALUE,&total3); - ReportWithPackageFilter(InitFilter,"load initial values from EEPROM", __FILE__,__LINE__,total3, RpMessage, total1, 0); - WHS_MAX11614_Load_OrificeZeroValue(total1,total3); + ReportWithPackageFilter(InitFilter,"load initial values from EEPROM", __FILE__,0,total3, RpMessage, total1, 0); + WHS_MAX11614_Load_OrificeZeroValue(total1,0,total3); } } HeadBlowersInit(); @@ -619,7 +622,7 @@ uint32_t InitSequenceStartHeating(void) SetMachineReadyForHeating(true); if(Head_Type == HEAD_TYPE_ARC) { MotorMovetoLimitSwitch(MotorId,1-MotorsCfg[MotorId].directionthreadwize, 50, Motor_Id_to_LS_IdDown[MotorId], cleaningMotorCBFunction,30000); - } else { + } else if(Head_Type == HEAD_TYPE_FLAT){ HeadCard_Actuators_Relocate(); } //SetMachineStatus(MACHINE_STATE__Ready); //prevent job while waiting for the cooler -- cgit v1.3.1 From 84103e5dd222064c4a81c62515186766e134f057 Mon Sep 17 00:00:00 2001 From: Avi Levkovich Date: Wed, 7 Oct 2020 14:22:07 +0300 Subject: Add VOC Alarm --- Software/Embedded_SW/Embedded/DataDef.h | 2 ++ .../WHS_Card/D_AD5272_Rheostat/WHS_Rheostat.c | 2 ++ .../WHS_Card/D_AD5272_Rheostat/WHS_Rheostat.h | 2 ++ .../Embedded/Modules/AlarmHandling/AlarmHandling.c | 2 +- .../Embedded/Modules/Control/MillisecTask.c | 7 +++- .../Embedded/Modules/Diagnostics/Diagnostics.c | 8 +++++ .../Embedded_SW/Embedded/Modules/Waste/Waste_ex.h | 3 ++ .../Embedded/Modules/Waste/Waste_maint.c | 42 ++++++++++++++++++++++ 8 files changed, 66 insertions(+), 2 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Control') diff --git a/Software/Embedded_SW/Embedded/DataDef.h b/Software/Embedded_SW/Embedded/DataDef.h index aec6f830e..66f2a20f1 100644 --- a/Software/Embedded_SW/Embedded/DataDef.h +++ b/Software/Embedded_SW/Embedded/DataDef.h @@ -39,6 +39,8 @@ extern bool Special_Dispensers; #define USE_OLD_HEAD_EEPROM +//#define USE_VOC_BUZZER_ALARM + #define I2C_2_Data_Transfer_Rate_400kbps #define I2C_3_Data_Transfer_Rate_400kbps// Head card + WHS card #define I2C_4_Data_Transfer_Rate_400kbps// RFID + Dispensers diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_AD5272_Rheostat/WHS_Rheostat.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_AD5272_Rheostat/WHS_Rheostat.c index e96c2367e..8ece96f99 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_AD5272_Rheostat/WHS_Rheostat.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_AD5272_Rheostat/WHS_Rheostat.c @@ -242,6 +242,8 @@ uint32_t Read_Gas_Sensor() //cyclic Latest_Gas_Sens_PPM = VOC2PPM(latest_Gas_Sensor_value); + WHS_IsVocPpmOverAlarmLimit(); + return OK; } diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_AD5272_Rheostat/WHS_Rheostat.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_AD5272_Rheostat/WHS_Rheostat.h index d6b1e3fd5..735df036d 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_AD5272_Rheostat/WHS_Rheostat.h +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_AD5272_Rheostat/WHS_Rheostat.h @@ -20,4 +20,6 @@ double Get_latest_Gas_Sensor_PPM(); void Voc_Sensor_Zero_Calibration(); +extern double Latest_Gas_Sens_PPM; + #endif diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c index b5c24835a..ca6c4d51f 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c @@ -983,7 +983,7 @@ JobEndReasonEnum AlarmHandlingPrepareJob(void *CurrentJob) { case EVENT_TYPE__INSUFFICIENT_AIR_FLOW: case EVENT_TYPE__VOC_SENSOR_ALARM_TIME: - case EVENT_TYPE__VOC_SENSOR_ALARM_SLOPE: +#warning unmark to prevent job on voc alarm//case EVENT_TYPE__VOC_SENSOR_ALARM_SLOPE: //case EVENT_TYPE__POWER_UP_BIT_FAILURE: FoundReason = JOB_WASTE_HANDLING_PROBLEM; AlarmId = Alarm_i; diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index 5f1c0ffaf..70a7e39b0 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -780,6 +780,11 @@ uint32_t MillisecLowLoop(uint32_t tick) WHS_Blower_Avarege(DRIER_FLOW_METER); WHS_Start_Blower_Control_Closed_Loop (); + if (ReadingVocEverySec == true)//eOneSecond + { + Trigger_WHS_MAX11614_Read_Gas_Sensor(); + } + /* static uint8_t Whs_emptying_cycle = 0; // #warning TBD need to define the timing @@ -827,7 +832,7 @@ uint32_t MillisecLowLoop(uint32_t tick) Gas_PPM_Info = Calculate_Gas_Power_Consumption();*/ // ReportWithPackageFilter(ThreadFilter,"waste tank calculate level",__FILE__,__LINE__,(int)(GetWHSWasteTankLevelMiliLiter()*1000),RpWarning,(int) msec_millisecondCounter,0); //Trigger_WHS_MAX11614_Read_allADC(); - if (WHS_Type == WHS_TYPE_NEW) + if ((WHS_Type == WHS_TYPE_NEW) && (ReadingVocEverySec == false))//OneMinute_Tick { Trigger_WHS_MAX11614_Read_Gas_Sensor(); } diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index 537f942b6..b069397d4 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -330,6 +330,14 @@ uint32_t DiagnosticsLoadDigitalValues(void) DigitalOutputState[index++].value = HeadCard_Actuators_Status(ACTOT); }*/ + #ifdef USE_VOC_BUZZER_ALARM + if (WHS_Type == WHS_TYPE_NEW) + { + DigitalOutputState[index].interfaceio = INTERFACE_IOS__GPO_BUZZER; + DigitalOutputState[index++].value = ReadingVocEverySec; // if true WHS_IsVocPpmOverAlarmLimit is true + } + #endif + DigitalOutputState[index].interfaceio = INTERFACE_IOS__GPI_WCONTAINER_FULL; DigitalOutputState[index++].value = WHS_IsContainerFull(); diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_ex.h b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_ex.h index ee9f668db..996191b63 100644 --- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_ex.h +++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_ex.h @@ -45,6 +45,9 @@ bool WHS_WasteCartridgeLowerPresent(); bool WHS_WasteCartridgeMiddlePresent(); bool WHS_IsEmptying(); uint32_t Waste_Prepare(void); +bool WHS_IsVocPpmOverAlarmLimit(); + +extern bool ReadingVocEverySec; #endif diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c index 2e3e665d6..28a5720ab 100644 --- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c @@ -23,6 +23,11 @@ #include #include #include +#include + +uint8_t VocPpmAlarmLimit = 10;//PPM +uint8_t VocPpmLimitForXSec = 10;//Sec +bool ReadingVocEverySec = false; bool DoorState = OPEN; uint32_t timeout_counter = 0; @@ -523,3 +528,40 @@ uint32_t Waste_Prepare(void) return JOB_WASTE_HANDLING_PROBLEM; } } + +bool WHS_IsVocPpmOverAlarmLimit() +{ + static uint8_t counter = 0; + uint8_t VocPpmAlarmLimit90Percent = 0; + uint32_t Temp = 0; + + Temp = (uint32_t)VocPpmAlarmLimit * 90; + Temp /= 100; + VocPpmAlarmLimit90Percent = (uint8_t)Temp; + + if( ( Latest_Gas_Sens_PPM > VocPpmAlarmLimit ) || //PPM + ( (Latest_Gas_Sens_PPM > VocPpmAlarmLimit90Percent) && (ReadingVocEverySec == true) ) ) //Hysteresis + { + //reading every sec + ReadingVocEverySec = true; + if(counter < 0xFF) + { + counter++; + } + + if(counter > VocPpmLimitForXSec)//Sec + { + AlarmHandlingSetAlarm(EVENT_TYPE__VOC_SENSOR_ALARM_SLOPE,true); + return true;//Buzzer ON if defined + } + } + else + { + AlarmHandlingSetAlarm(EVENT_TYPE__VOC_SENSOR_ALARM_SLOPE,false); + //move back to noraml reading every Min. + ReadingVocEverySec = false;//Turn off the buzzer on the first time sampling a measurment lower than (VocPpmAlarmLimit - 10%) + counter = 0; + } + + return false; +} -- cgit v1.3.1