break up sensors even more (#3318)

This commit is contained in:
Matthew Kennedy 2021-10-05 16:06:17 -07:00 committed by GitHub
parent b1d30eacb9
commit be1fa7057d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 11 deletions

View File

@ -548,21 +548,15 @@ static void updateRawSensors() {
tsOutputChannels.rawIdlePositionSensor = Sensor::getRaw(SensorType::IdlePosition);
}
static void updateSensors(int rpm) {
updateTempSensors();
updateThrottles();
updateRawSensors();
updateLambda();
updateFuelSensors();
updateVvtSensors();
updateVehicleSpeed(rpm);
tsOutputChannels.vBatt = Sensor::get(SensorType::BatteryVoltage).value_or(0);
static void updatePressures() {
tsOutputChannels.baroPressure = Sensor::get(SensorType::BarometricPressure).value_or(0);
tsOutputChannels.manifoldAirPressure = Sensor::get(SensorType::Map).value_or(0);
tsOutputChannels.oilPressure = Sensor::get(SensorType::OilPressure).Value;
}
static void updateMiscSensors() {
tsOutputChannels.vBatt = Sensor::get(SensorType::BatteryVoltage).value_or(0);
tsOutputChannels.idlePositionSensor = Sensor::get(SensorType::IdlePosition).value_or(0);
tsOutputChannels.wastegatePosition = Sensor::get(SensorType::WastegatePosition).value_or(0);
@ -575,6 +569,18 @@ static void updateSensors(int rpm) {
tsOutputChannels.tCharge = ENGINE(engineState.sd.tCharge);
}
static void updateSensors(int rpm) {
updateTempSensors();
updateThrottles();
updateRawSensors();
updateLambda();
updateFuelSensors();
updateVvtSensors();
updateVehicleSpeed(rpm);
updatePressures();
updateMiscSensors();
}
static void updateFuelCorrections() {
tsOutputChannels.baroCorrection = engine->engineState.baroCorrection;
tsOutputChannels.iatCorrection = ENGINE(engineState.running.intakeTemperatureCoefficient);