AIM dash TPS, CLT,IAT, and Batt V fix (#3922)

This commit is contained in:
Benas Brazdziunas 2022-02-11 23:42:51 +00:00 committed by GitHub
parent 2f1957cc0c
commit c0e28e35bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 12 deletions

View File

@ -1112,8 +1112,8 @@ struct Aim5f0 {
static void populateFrame(Aim5f0& msg) {
msg.Rpm = Sensor::getOrZero(SensorType::Rpm);
msg.Tps = Sensor::getOrZero(SensorType::Tps1);
msg.Pps = Sensor::getOrZero(SensorType::AcceleratorPedal);
msg.Tps = 10 * Sensor::getOrZero(SensorType::Tps1);
msg.Pps = 10 * Sensor::getOrZero(SensorType::AcceleratorPedal);
msg.Vss = Sensor::getOrZero(SensorType::VehicleSpeed);
}
@ -1133,17 +1133,17 @@ static void populateFrame(Aim5f1& msg) {
}
struct Aim5f2 {
scaled_channel<uint16_t, 10> Iat;
scaled_channel<uint16_t, 10> Ect;
scaled_channel<uint16_t, 10> FuelT;
scaled_channel<uint16_t, 10> OilT;
scaled_channel<uint16_t, 19> Iat;
scaled_channel<uint16_t, 19> Ect;
scaled_channel<uint16_t, 19> FuelT;
scaled_channel<uint16_t, 19> OilT;
};
static void populateFrame(Aim5f2& msg) {
msg.Iat = Sensor::getOrZero(SensorType::Iat) + 45;
msg.Ect = Sensor::getOrZero(SensorType::Clt) + 45;
msg.FuelT = Sensor::getOrZero(SensorType::AuxTemp1) + 45;
msg.OilT = Sensor::getOrZero(SensorType::AuxTemp2) + 45;
msg.Iat = (10 * Sensor::getOrZero(SensorType::Iat)) + 450;
msg.Ect = (10 * Sensor::getOrZero(SensorType::Clt)) + 450;
msg.FuelT = (10 * Sensor::getOrZero(SensorType::AuxTemp1)) + 450;
msg.OilT = (10 * Sensor::getOrZero(SensorType::AuxTemp2)) + 450;
}
struct Aim5f3 {
@ -1165,7 +1165,7 @@ static void populateFrame(Aim5f3& msg) {
struct Aim5f4 {
scaled_channel<uint16_t, 10000> Boost;
scaled_channel<uint16_t, 10> Vbat;
scaled_channel<uint16_t, 32> Vbat;
scaled_channel<uint16_t, 10> FuelUse;
scaled_channel<uint16_t, 10> Gear;
};
@ -1176,7 +1176,7 @@ static void populateFrame(Aim5f4& msg) {
float boostBar = deltaKpa / 100;
msg.Boost = boostBar;
msg.Vbat = Sensor::getOrZero(SensorType::BatteryVoltage);
msg.Vbat = 100 * Sensor::getOrZero(SensorType::BatteryVoltage);
msg.FuelUse = 0;
msg.Gear = 0;
}