diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2020-02-04 18:58:19 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2020-02-04 18:58:19 +0200 |
| commit | ecc2fd3bbf37b3a26c59fb3bb5df35a73ccea9d5 (patch) | |
| tree | 3e2da4420da76dad47abe00ac93fb4e9c0c69967 /Software/Embedded_SW | |
| parent | bee3522e23c95021a9637669a8091069af98e0c4 (diff) | |
| parent | d942ac7b9d38d7a9afbe0c684ace022f07730f66 (diff) | |
| download | Tango-ecc2fd3bbf37b3a26c59fb3bb5df35a73ccea9d5.tar.gz Tango-ecc2fd3bbf37b3a26c59fb3bb5df35a73ccea9d5.zip | |
merge
Diffstat (limited to 'Software/Embedded_SW')
6 files changed, 32 insertions, 27 deletions
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_ADS122_PT100/WHS_PT100_ADC.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_ADS122_PT100/WHS_PT100_ADC.c index 82b6d22ed..d34787671 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_ADS122_PT100/WHS_PT100_ADC.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_ADS122_PT100/WHS_PT100_ADC.c @@ -237,6 +237,7 @@ bool WHS_PT100_Get(TEMPERATURE_SENSOR_ID_ENUM SensorId, uint8_t *value ) bool WHS_PT100_Read(TEMPERATURE_SENSOR_ID_ENUM SensorId) { bool Status = OK; + uint32_t Temperatures = 0; WHS_PT100_config( SensorId); WHS_PT100_ControlMux_Before_Reading( SensorId); @@ -246,31 +247,37 @@ bool WHS_PT100_Read(TEMPERATURE_SENSOR_ID_ENUM SensorId) Status |= D_ADS122_StartSync(PT100_Conf[0].i2s_bus, PT100_Conf[0].i2s_address); delayms(20); Status |= D_ADS122_ReadDataCommand(PT100_Conf[0].i2s_bus, PT100_Conf[0].i2s_address, &(PT100_Conf[0].value[0])); - ReportWithPackageFilter(WasteFilter,"------------read PT100 0 0 [J11] (value) -----------------", __FILE__,__LINE__, PT100_Conf[0].value[0], RpMessage, 0, 0); + Temperatures = CalculateTemperatures(SensorId, PT100_Conf[0].value[0]); + ReportWithPackageFilter(WasteFilter,"------------read PT100 0 0 [J11] (value) -----------------", __FILE__,__LINE__, PT100_Conf[0].value[0], RpMessage, Temperatures, 0); break; case WHS_PT100_2_0X80_1: Status |= D_ADS122_StartSync(PT100_Conf[0].i2s_bus, PT100_Conf[0].i2s_address); delayms(20); Status |= D_ADS122_ReadDataCommand(PT100_Conf[0].i2s_bus, PT100_Conf[0].i2s_address, &(PT100_Conf[0].value[1])); - ReportWithPackageFilter(WasteFilter,"------------read PT100 0 0 [J20] (value) -----------------", __FILE__,__LINE__, PT100_Conf[0].value[1], RpMessage, 0, 0); + Temperatures = CalculateTemperatures(SensorId, PT100_Conf[0].value[1]); + ReportWithPackageFilter(WasteFilter,"------------read PT100 0 0 [J20] (value) -----------------", __FILE__,__LINE__, PT100_Conf[0].value[1], RpMessage, Temperatures, 0); break; case WHS_PT100_3_0X82_0: Status |= D_ADS122_StartSync(PT100_Conf[1].i2s_bus, PT100_Conf[1].i2s_address); delayms(20); Status |= D_ADS122_ReadDataCommand(PT100_Conf[1].i2s_bus, PT100_Conf[1].i2s_address, &(PT100_Conf[1].value[0])); - ReportWithPackageFilter(WasteFilter,"------------read PT100 0 0 [J12] (value) -----------------", __FILE__,__LINE__, PT100_Conf[1].value[0], RpMessage, 0, 0); + Temperatures = CalculateTemperatures(SensorId, PT100_Conf[1].value[0]); + ReportWithPackageFilter(WasteFilter,"------------read PT100 0 0 [J12] (value) -----------------", __FILE__,__LINE__, PT100_Conf[1].value[0], RpMessage, Temperatures, 0); break; case WHS_PT100_4_0X82_1: Status |= D_ADS122_StartSync(PT100_Conf[1].i2s_bus, PT100_Conf[1].i2s_address); delayms(20); Status |= D_ADS122_ReadDataCommand(PT100_Conf[1].i2s_bus, PT100_Conf[1].i2s_address, &(PT100_Conf[1].value[1])); - ReportWithPackageFilter(WasteFilter,"------------read PT100 0 0 [J21] (value) -----------------", __FILE__,__LINE__, PT100_Conf[1].value[1], RpMessage, 0, 0); + Temperatures = CalculateTemperatures(SensorId, PT100_Conf[1].value[1]); + ReportWithPackageFilter(WasteFilter,"------------read PT100 0 0 [J21] (value) -----------------", __FILE__,__LINE__, PT100_Conf[1].value[1], RpMessage, Temperatures, 0); break; default: Status = ERROR; break; } + #warning what to do with the data ??????? + 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 56e54d567..f5c0b0ea9 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 @@ -189,7 +189,7 @@ double get_Q(int16_t num) Sqrt = sqrt((double)tmp); calc = Aorf_ofset + Corf_flow*Sqrt; - ReportWithPackageFilter(WasteFilter,"------------ calc Q value (calc)-----------------", __FILE__,__LINE__, calc, RpMessage, 0, 0); + ReportWithPackageFilter(WasteFilter,"------------ calc Q value (calc)-----------------", __FILE__,__LINE__, calc, RpMessage, num, 0); return calc; } @@ -266,7 +266,7 @@ bool get_orf_1(uint16_t *value) // U34 connected to AIN2 uint16_t Orf_zero_value[HEAD_FLOW_METER+1] = {1112,0,1040}; - +#warning get Orf_zero_value for all orf double GetWHSAirFlow(uint8_t OR_Id) { @@ -286,7 +286,7 @@ double GetWHSAirFlow(uint8_t OR_Id) break; } - ReportWithPackageFilter(WasteFilter,"GetWHSAirFlow",__FILE__,OR_Id,(int)value,RpWarning,(int) Orf_zero_value[OR_Id],0); + ReportWithPackageFilter(WasteFilter,"------------ GetWHSAirFlow -----------------",__FILE__, OR_Id, (int)value, RpWarning, (int) Orf_zero_value[OR_Id], 0); return get_Q((int16_t)value-Orf_zero_value[OR_Id]); } 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 abce25764..bcada0e0d 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 @@ -58,12 +58,12 @@ bool Read_Max5805_device_ID() status = MAX5805_DEVICEID(); if ((Read_Buf[0] == 0x50) && (Read_Buf[1] == 0x82)) { - ReportWithPackageFilter(GeneralFilter,"------------ max5805 ID OK -----------------", __FILE__,__LINE__,(Read_Buf[0]), RpMessage,(Read_Buf[1]), 0); + ReportWithPackageFilter(GeneralFilter,"------------ max5805 ID OK -----------------", __FILE__, __LINE__, (Read_Buf[0]), RpMessage, (Read_Buf[1]), 0); status |= OK; } else { - ReportWithPackageFilter(GeneralFilter,"------------ max5805 ID NOT OK !!!! -----------------", __FILE__,__LINE__,(Read_Buf[0]), RpMessage,(Read_Buf[1]), 0); + ReportWithPackageFilter(GeneralFilter,"------------ max5805 ID NOT OK !!!! -----------------", __FILE__, __LINE__, (Read_Buf[0]), RpMessage, (Read_Buf[1]), 0); status |= ERROR; } return status; @@ -163,7 +163,8 @@ bool WHS_init_Blower() } status |= Write_MAX5805_REF( ); - ReportWithPackageFilter(WasteFilter,"------------ WHS_init_Blower (status)-----------------", __FILE__,__LINE__, status, RpMessage, 0, 0); + status |= WHS_Set_Volt_Blower_Control(0); // init with 0 volt + ReportWithPackageFilter(WasteFilter,"------------ WHS_init_Blower (status) 0V-----------------", __FILE__,__LINE__, status, RpMessage, 0, 0); return status; } diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_TCA9546_ADC_MUX/TCA9546_Driver.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_TCA9546_ADC_MUX/TCA9546_Driver.c index 28c3ded82..a472fb9eb 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_TCA9546_ADC_MUX/TCA9546_Driver.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_TCA9546_ADC_MUX/TCA9546_Driver.c @@ -37,7 +37,7 @@ bool D_TCA9546_Select_Channel(uint8_t TCA9546A_I2C_bus_number, uint8_t TCA9546A_ } Write_Buf[0]=chnl_number; status |= I2C_Write(TCA9546A_I2C_bus_number, TCA9546A_I2C_addr, Write_Buf, 1); - ReportWithPackageFilter(WasteFilter,"------------ Select I2C Channel (chnl_number)-----------------", __FILE__,__LINE__, chnl_number, status, 0, 0); + ReportWithPackageFilter(WasteFilter,"------------ Select I2C Channel (chnl_number)-----------------", __FILE__,__LINE__, chnl_number, RpMessage, status, 0); return status; } diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/IO_Extender_Ports_TCA9555/WHS_IO.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/IO_Extender_Ports_TCA9555/WHS_IO.c index 4deba2060..638582e7f 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/IO_Extender_Ports_TCA9555/WHS_IO.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/IO_Extender_Ports_TCA9555/WHS_IO.c @@ -126,7 +126,7 @@ bool WHS_IO_Init() { bool status = OK; - ReportWithPackageFilter(WasteFilter,"------------ WHS_IO_Init IO_Extender U3 and U4 -----------------", __FILE__,__LINE__,0, 0, 0, 0); + ReportWithPackageFilter(WasteFilter,"------------ WHS_IO_Init IO_Extender U3 and U4 -----------------", __FILE__,__LINE__,0, RpMessage, 0, 0); Whs_I2C_EXP_U3_0x40_VALUE.bits.VALUE_ACTLOW_PT_RSTn = 1; //P00 Whs_I2C_EXP_U3_0x40_VALUE.bits.VALUE_PT_SEL = 1; //P01 Whs_I2C_EXP_U3_0x40_VALUE.bits.VALUE_ACTLOW_AUXn = 1; //P02 @@ -223,11 +223,11 @@ bool Set_WHS_valve(uint8_t valve_number, bool state, bool direction) { if (state == VALVE_DISABLE ) { - ReportWithPackageFilter(WasteFilter,"------------ set valve 0 Disable-----------------", __FILE__,__LINE__, state, direction, 0, 0); + ReportWithPackageFilter(WasteFilter,"------------ set valve 0 Disable-----------------", __FILE__,__LINE__, state, RpMessage, direction, 0); } else { - ReportWithPackageFilter(WasteFilter,"------------ set valve 0 Enable-----------------", __FILE__,__LINE__, state, direction, 0, 0); + ReportWithPackageFilter(WasteFilter,"------------ set valve 0 Enable-----------------", __FILE__,__LINE__, state, RpMessage, direction, 0); } Whs_I2C_EXP_U4_0x42_VALUE.bits.VALUE_VALV1_DIR = direction; //P04 Whs_I2C_EXP_U4_0x42_VALUE.bits.VALUE_VALV1_EN = state; //P05 @@ -236,11 +236,11 @@ bool Set_WHS_valve(uint8_t valve_number, bool state, bool direction) { if (state == VALVE_DISABLE ) { - ReportWithPackageFilter(WasteFilter,"------------ set valve 1 Disable-----------------", __FILE__,__LINE__, state, direction, 0, 0); + ReportWithPackageFilter(WasteFilter,"------------ set valve 1 Disable-----------------", __FILE__,__LINE__, state, RpMessage, direction, 0); } else { - ReportWithPackageFilter(WasteFilter,"------------ set valve 1 Enable-----------------", __FILE__,__LINE__, state, direction, 0, 0); + ReportWithPackageFilter(WasteFilter,"------------ set valve 1 Enable-----------------", __FILE__,__LINE__, state, RpMessage, direction, 0); } Whs_I2C_EXP_U4_0x42_VALUE.bits.VALUE_VALV2_DIR = direction; //P04 Whs_I2C_EXP_U4_0x42_VALUE.bits.VALUE_VALV2_EN = state; //P05 @@ -266,11 +266,11 @@ bool Write_WHS_pump(bool state) { if (state == PUMP_ENABLE ) { - ReportWithPackageFilter(WasteFilter,"------------ Write_WHS_pump ON-----------------", __FILE__,__LINE__, state, 0, 0, 0); + ReportWithPackageFilter(WasteFilter,"------------ Write_WHS_pump ON-----------------", __FILE__,__LINE__, state, RpMessage, 0, 0); } else { - ReportWithPackageFilter(WasteFilter,"------------ Write_WHS_pump OFF-----------------", __FILE__,__LINE__, state, 0, 0, 0); + ReportWithPackageFilter(WasteFilter,"------------ Write_WHS_pump OFF-----------------", __FILE__,__LINE__, state, RpMessage, 0, 0); } Whs_I2C_EXP_U3_0x40_VALUE.bits.VALUE_PUMP_ON = state; status = WHS_Write_IO( I2CExp1_ADDRESS, D_TCA9555_PORT_0); diff --git a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c index a358bd724..7f99a2a92 100644 --- a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c +++ b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c @@ -104,15 +104,13 @@ bool DetectIfCartridgeFinished(int int_MidTank_Pressure_1000) WHS_sensor CartridgeInkCallBackFunction() { - uint32_t parameter = 6 ; - - WHS_sensor ret = WHS_no_event; + WHS_sensor ret = WHS_no_event; if (IFS_info.IFS_Ink_precense_sensor != RdInkCartridgeSensor()) { - REPORT_MSG(parameter," ------------ find : IFS_Ink_presence_sensor event ----------------- "); 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); ret = IFS_INK_presence_sensor; } return ret; @@ -173,11 +171,10 @@ WHS_sensor CartridgeInkTimeOutCallBackFunction() /*** first TimeOut ***/ if (IFS_info.Ink.time_out == CARTRIDGE_INK_TIMEOUT) { - ReportWithPackageFilter(WasteFilter,"------------ first IFS_info.Ink.time_out -----------------", __FILE__, __LINE__, (IFS_info.Ink.time_out * SECONDS_5), RpMessage, MidTank_Pressure, 0); + 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); //IFS_info.Ink.time_out = 0; //return IFS_info.event = IFS_Timeout; - REPORT_MSG(WHS_emptying," ------------ IFS_Timeout close valves----------------- "); // try again : // start timeout // close and open the correct valves @@ -189,13 +186,13 @@ WHS_sensor CartridgeInkTimeOutCallBackFunction() if (IFS_info.Ink.time_out == (CARTRIDGE_INK_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, MidTank_Pressure, 0); + ReportWithPackageFilter(WasteFilter,"------------ 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); } if (IFS_info.Ink.time_out >= (CARTRIDGE_INK_TIMEOUTx2 + 1)) { - REPORT_MSG(WHS_full," ------------ IFS_Timeout_Second_Time ----------------- "); + ReportWithPackageFilter(WasteFilter,"------------ 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; @@ -295,7 +292,7 @@ uint32_t ReadCartridgeData(cartridge_name cart_name) //------------------------------------------------------------------------------------------- uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); size_t container_size = message_container__pack(&responseContainer, container_buffer); - REPORT_MSG(WHS_full," ------------ IFS: send message_container__pack ----------------- "); + ReportWithPackageFilter(WasteFilter,"------------ IFS: send message_container__pack -----------------", __FILE__, __LINE__, CARTRIDGE_ACTION__Inserted, RpMessage, 0, 0); my_free(responseContainer.data.data); SendChars((char*)container_buffer, container_size); |
