From ffe5c0bf992f3cfd7a87a692d0b5eee6a3976a11 Mon Sep 17 00:00:00 2001 From: cfif Date: Wed, 3 Jun 2026 11:24:41 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=BB=D0=B0=D1=82=D1=8B=20=D0=BD?= =?UTF-8?q?=D0=B0=20V2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AdcTasks.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/AdcTasks.c b/AdcTasks.c index 677db34..0b412ca 100644 --- a/AdcTasks.c +++ b/AdcTasks.c @@ -190,7 +190,7 @@ void ANALOG_SENSOR(tAdc0Task *env, char *desc, uint16_t adc_value, eNtcTable Ntc LoggerFormatInfo(LOGGER, LOG_SIGN, "%s: Error !!! (adc = %d)", desc, adc_value) } else { // Преобразование в напряжение - float U = (float) adc_value * 4.96f / 4095.0f; + float U = (float) adc_value * 5.0f / 4095.0f; float temp = 0; float Rntc = 0; @@ -203,23 +203,25 @@ void ANALOG_SENSOR(tAdc0Task *env, char *desc, uint16_t adc_value, eNtcTable Ntc case TABLE_DUCT: if (R == 3000) { -// temp = get_temperature_by_adc(temperature_table_duct_KST45_table_3000, 1024, adc_value); - temp = lookup_table_get_temp(temperature_table_duct_KST45_table_3000, adc_value); + temp = get_temperature_by_adc(temperature_table_duct_KST45_table_3000, 1024, adc_value); +// temp = lookup_table_get_temp(temperature_table_duct_KST45_table_3000, adc_value); Rntc = calculate_ntc_resistance(adc_value, 3000, 4.96f, 5.0f, 4095); } if (R == 20000) { -// temp = get_temperature_by_adc(temperature_table_duct_KST45_table_3000, 1024, adc_value); - temp = lookup_table_get_temp(temperature_table_duct_KST45_table_20000, adc_value); + temp = get_temperature_by_adc(temperature_table_duct_KST45_table_20000, 1024, adc_value); +// temp = lookup_table_get_temp(temperature_table_duct_KST45_table_20000, adc_value); Rntc = calculate_ntc_resistance(adc_value, 20000, 4.96f, 5.0f, 4095); } break; case TABLE_INCAR: - temp = lookup_table_get_temp(incar_lookup_table, adc_value); + temp = get_temperature_by_adc(incar_lookup_table, 1024, adc_value); +// temp = lookup_table_get_temp(incar_lookup_table, adc_value); Rntc = calculate_ntc_resistance(adc_value, 20000, 4.96f, 5.0f, 4095); break; case TABLE_AMBIENT: - temp = lookup_table_get_temp(ambient_lookup_table, adc_value); + temp = get_temperature_by_adc(ambient_lookup_table, 1024, adc_value); +// temp = lookup_table_get_temp(ambient_lookup_table, adc_value); Rntc = calculate_ntc_resistance(adc_value, 20000, 4.96f, 5.0f, 4095); break; @@ -494,7 +496,7 @@ static _Noreturn void Adc0_Thread(tAdc0Task *env) { ANALOG_SENSOR(env, "Sensor_Front_Duct5 (dbg_Sen_Duct_FL_Side_Fb)", rtDW.ADC_Data_Model.Sensor_Front_Duct5, TABLE_DUCT, 3000); ANALOG_SENSOR(env, "Sensor_Front_Duct6 (dbg_Sen_Duct_FR_Side_Fb)", rtDW.ADC_Data_Model.Sensor_Front_Duct6, TABLE_DUCT, 3000); */ -/* + LoggerErrorStatic(LOGGER, LOG_SIGN, "======================================================================"); ANALOG_SENSOR(env, "Sensor_Front_Duct1 (dbg_Sen_Duct_FL_Upper_Fb)", rtDW.ADC_Data_Model.Sensor_Front_Duct1, TABLE_DUCT, 3000); @@ -517,7 +519,7 @@ static _Noreturn void Adc0_Thread(tAdc0Task *env) { ANALOG_SENSOR(env, "Sensor_Incar_Temp_FR", rtDW.ADC_Data_Model.Sensor_Incar_Temp_FR, TABLE_INCAR, 20000); ANALOG_SENSOR(env, "Sensor_Incar_Temp_RR", rtDW.ADC_Data_Model.Sensor_Incar_Temp_RR, TABLE_INCAR, 20000); LoggerErrorStatic(LOGGER, LOG_SIGN, "======================================================================"); -*/ + // ANALOG_SENSOR(env, "Sensor_Rear_Duct3", rtDW.ADC_Data_Model.Sensor_Rear_Duct3, TABLE_DUCT, 3000);