TPMS temperature wrong calc

This commit is contained in:
Carsten Schmiemann 2022-05-09 16:24:37 +02:00
parent c7758be02b
commit e0d0968211
1 changed files with 4 additions and 4 deletions

View File

@ -57,28 +57,28 @@ void OvmsVehicleRenaultZoePh2::IncomingBCM(uint16_t type, uint16_t pid, const ch
}
case 0x6310: { // TPMS temp - front left
if (CAN_UINT(0) < 32512) {
StandardMetrics.ms_v_tpms_temp->SetElemValue(MS_V_TPMS_IDX_FL, fabs((CAN_UINT(0) * 0.001) - 30.0f), Celcius);
StandardMetrics.ms_v_tpms_temp->SetElemValue(MS_V_TPMS_IDX_FL, (30.0f - (CAN_UINT(0) * 0.001)), Celcius);
}
//ESP_LOGD(TAG, "6310 BCM tpms temp FL: %f", fabs((CAN_UINT(0) * 0.001) - 30.0f));
break;
}
case 0x6311: { // TPMS temp - front right
if (CAN_UINT(0) < 32512) {
StandardMetrics.ms_v_tpms_temp->SetElemValue(MS_V_TPMS_IDX_FR, fabs((CAN_UINT(0) * 0.001) - 30.0f), Celcius);
StandardMetrics.ms_v_tpms_temp->SetElemValue(MS_V_TPMS_IDX_FR, (30.0f - (CAN_UINT(0) * 0.001)), Celcius);
}
//ESP_LOGD(TAG, "6311 BCM tpms temp FR: %f", fabs((CAN_UINT(0) * 0.001) - 30.0f));
break;
}
case 0x6312: { // TPMS temp - rear left
if (CAN_UINT(0) < 32512) {
StandardMetrics.ms_v_tpms_temp->SetElemValue(MS_V_TPMS_IDX_RL, fabs((CAN_UINT(0) * 0.001) - 30.0f), Celcius);
StandardMetrics.ms_v_tpms_temp->SetElemValue(MS_V_TPMS_IDX_RL, (30.0f - (CAN_UINT(0) * 0.001)), Celcius);
}
//ESP_LOGD(TAG, "6312 BCM tpms temp RL: %f", fabs((CAN_UINT(0) * 0.001) - 30.0f));
break;
}
case 0x6313: { // TPMS temp - rear right
if (CAN_UINT(0) < 32512) {
StandardMetrics.ms_v_tpms_temp->SetElemValue(MS_V_TPMS_IDX_RR, fabs((CAN_UINT(0) * 0.001) - 30.0f), Celcius);
StandardMetrics.ms_v_tpms_temp->SetElemValue(MS_V_TPMS_IDX_RR, (30.0f - (CAN_UINT(0) * 0.001)), Celcius);
}
//ESP_LOGD(TAG, "6313 BCM tpms temp RR: %f", fabs((CAN_UINT(0) * 0.001) - 30.0f));
break;