very random progress

This commit is contained in:
rusefillc 2022-04-16 16:49:59 -04:00
parent 0b21ddce9c
commit c023056d2d
4 changed files with 8 additions and 1 deletions

View File

@ -33,6 +33,7 @@ int IdleController::getTargetRpm(float clt) {
}
IIdleController::Phase IdleController::determinePhase(int rpm, int targetRpm, SensorResult tps, float vss, float crankingTaperFraction) {
#if EFI_SHAFT_POSITION_INPUT
if (!engine->rpmCalculator.isRunning()) {
return Phase::Cranking;
}
@ -67,6 +68,7 @@ IIdleController::Phase IdleController::determinePhase(int rpm, int targetRpm, Se
if (looksLikeCrankToIdle) {
return Phase::CrankToIdleTaper;
}
#endif // EFI_SHAFT_POSITION_INPUT
// No other conditions met, we are idling!
return Phase::Idling;

View File

@ -93,7 +93,7 @@ expected<percent_t> VvtController::getClosedLoop(angle_t target, angle_t observa
void VvtController::setOutput(expected<percent_t> outputValue) {
float rpm = Sensor::getOrZero(SensorType::Rpm);
#if EFI_SHAFT_POSITION_INPUT
bool enabled = rpm > engineConfiguration->cranking.rpm /* todo: make this configurable? */
&& engine->rpmCalculator.getSecondsSinceEngineStart(getTimeNowNt()) > engineConfiguration->vvtActivationDelayMs / MS_PER_SECOND
;
@ -106,6 +106,7 @@ void VvtController::setOutput(expected<percent_t> outputValue) {
// we need to avoid accumulating iTerm while engine is not running
m_pid.reset();
}
#endif // EFI_SHAFT_POSITION_INPUT
}
#if EFI_AUX_PID

View File

@ -112,7 +112,9 @@ struct Sensors2 {
static void populateFrame(Sensors2& msg) {
msg.afr = Sensor::getOrZero(SensorType::Lambda1) * STOICH_RATIO;
msg.oilPressure = Sensor::get(SensorType::OilPressure).value_or(-1);
#if EFI_SHAFT_POSITION_INPUT
msg.vvtPos = engine->triggerCentral.getVVTPosition(0, 0);
#endif // EFI_SHAFT_POSITION_INPUT
msg.vbatt = Sensor::getOrZero(SensorType::BatteryVoltage);
}

View File

@ -46,6 +46,7 @@ void FallbackSensor::showInfo(const char* sensorName) const {
}
void RpmCalculator::showInfo(const char* /*sensorName*/) const {
#if EFI_SHAFT_POSITION_INPUT
efiPrintf("RPM sensor: stopped: %d spinning up: %d cranking: %d running: %d rpm: %f",
isStopped(),
isSpinningUp(),
@ -53,6 +54,7 @@ void RpmCalculator::showInfo(const char* /*sensorName*/) const {
isRunning(),
get().value_or(0)
);
#endif // EFI_SHAFT_POSITION_INPUT
}
void Lps25Sensor::showInfo(const char* sensorName) const {