Обновление платы на V2
This commit is contained in:
parent
1e01e12273
commit
ffe5c0bf99
20
AdcTasks.c
20
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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue