very random progress
This commit is contained in:
parent
0b21ddce9c
commit
c023056d2d
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue