very random progress
This commit is contained in:
parent
c023056d2d
commit
70e4d118ef
|
@ -149,10 +149,11 @@ float IdleController::getIdleTimingAdjustment(int rpm, int targetRpm, Phase phas
|
|||
m_timingPid.reset();
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if EFI_SHAFT_POSITION_INPUT
|
||||
if (engineConfiguration->useInstantRpmForIdle) {
|
||||
rpm = engine->triggerCentral.triggerState.getInstantRpm();
|
||||
}
|
||||
#endif // EFI_SHAFT_POSITION_INPUT
|
||||
|
||||
// If inside the deadzone, do nothing
|
||||
if (absI(rpm - targetRpm) < engineConfiguration->idleTimingPidDeadZone) {
|
||||
|
@ -273,6 +274,8 @@ float IdleController::getClosedLoop(IIdleController::Phase phase, float tpsPos,
|
|||
}
|
||||
|
||||
float IdleController::getIdlePosition() {
|
||||
#if EFI_SHAFT_POSITION_INPUT
|
||||
|
||||
// Simplify hardware CI: we borrow the idle valve controller as a PWM source for various stimulation tasks
|
||||
// The logic in this function is solidly unit tested, so it's not necessary to re-test the particulars on real hardware.
|
||||
#ifdef HARDWARE_CI
|
||||
|
@ -358,8 +361,11 @@ float IdleController::getIdlePosition() {
|
|||
#endif /* EFI_TUNER_STUDIO */
|
||||
|
||||
currentIdlePosition = iacPosition;
|
||||
|
||||
return iacPosition;
|
||||
#else
|
||||
return 0;
|
||||
#endif // EFI_SHAFT_POSITION_INPUT
|
||||
|
||||
}
|
||||
|
||||
void IdleController::onSlowCallback() {
|
||||
|
|
|
@ -699,6 +699,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|||
msg[7] = 0x00;
|
||||
}
|
||||
|
||||
#if EFI_SHAFT_POSITION_INPUT
|
||||
/* 0x369 - 20Hz rate */
|
||||
{
|
||||
CanTxMessage msg(0x369, 8);
|
||||
|
@ -717,6 +718,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|||
msg[6] = 0x00;
|
||||
msg[7] = 0x00;
|
||||
}
|
||||
#endif // EFI_SHAFT_POSITION_INPUT
|
||||
|
||||
/* 0x36A - 20Hz rate */
|
||||
/* todo: one day we should split this */
|
||||
|
|
|
@ -85,7 +85,7 @@ private:
|
|||
UNUSED(nowNt);
|
||||
|
||||
validateStack("MIL", STACK_USAGE_MIL, 128);
|
||||
|
||||
#if EFI_SHAFT_POSITION_INPUT
|
||||
if (nowNt - engine->triggerCentral.triggerState.mostRecentSyncTime < MS2NT(500)) {
|
||||
enginePins.checkEnginePin.setValue(1);
|
||||
chThdSleepMilliseconds(500);
|
||||
|
@ -100,6 +100,7 @@ private:
|
|||
int code = localErrorCopy.error_codes[p];
|
||||
DisplayErrorCode(DigitLength(code), code);
|
||||
}
|
||||
#endif // EFI_SHAFT_POSITION_INPUT
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ void LimpManager::updateState(int rpm, efitick_t nowNt) {
|
|||
allowFuel.clear(ClearReason::BoostCut);
|
||||
}
|
||||
}
|
||||
|
||||
#if EFI_SHAFT_POSITION_INPUT
|
||||
if (engine->rpmCalculator.isRunning()) {
|
||||
uint16_t minOilPressure = engineConfiguration->minOilPressureAfterStart;
|
||||
|
||||
|
@ -93,6 +93,8 @@ todo AndreiKA this change breaks 22 unit tests?
|
|||
*/
|
||||
}
|
||||
|
||||
#endif // EFI_SHAFT_POSITION_INPUT
|
||||
|
||||
#if EFI_LAUNCH_CONTROL
|
||||
// Fuel cut if launch control engaged
|
||||
if (engine->launchController.isLaunchFuelRpmRetardCondition()) {
|
||||
|
|
|
@ -43,7 +43,7 @@ void TriggerEmulatorHelper::handleEmulatorCallback(const MultiChannelStateSequen
|
|||
efitick_t stamp = getTimeNowNt();
|
||||
|
||||
// todo: code duplication with TriggerStimulatorHelper::feedSimulatedEvent?
|
||||
|
||||
#if EFI_SHAFT_POSITION_INPUT
|
||||
for (size_t i = 0; i < PWM_PHASE_MAX_WAVE_PER_PWM; i++) {
|
||||
if (needEvent(stateIndex, multiChannelStateSequence, i)) {
|
||||
pin_state_t currentValue = multiChannelStateSequence.getChannelState(/*phaseIndex*/i, stateIndex);
|
||||
|
@ -51,6 +51,7 @@ void TriggerEmulatorHelper::handleEmulatorCallback(const MultiChannelStateSequen
|
|||
handleShaftSignal(i, currentValue, stamp);
|
||||
}
|
||||
}
|
||||
#endif // EFI_SHAFT_POSITION_INPUT
|
||||
}
|
||||
|
||||
PwmConfig triggerSignal;
|
||||
|
|
|
@ -302,7 +302,9 @@ void applyNewHardwareSettings() {
|
|||
efiSetPadUnused(activeConfiguration.clutchUpPin);
|
||||
}
|
||||
|
||||
#if EFI_SHAFT_POSITION_INPUT
|
||||
stopTriggerDebugPins();
|
||||
#endif // EFI_SHAFT_POSITION_INPUT
|
||||
|
||||
enginePins.unregisterPins();
|
||||
|
||||
|
@ -464,10 +466,13 @@ void startHardware() {
|
|||
startJoystickPins();
|
||||
#endif /* HAL_USE_PAL && EFI_JOYSTICK */
|
||||
|
||||
#if EFI_SHAFT_POSITION_INPUT
|
||||
validateTriggerInputs();
|
||||
|
||||
startTriggerDebugPins();
|
||||
|
||||
#endif // EFI_SHAFT_POSITION_INPUT
|
||||
|
||||
startPedalPins();
|
||||
|
||||
#if EFI_CAN_SUPPORT
|
||||
|
|
Loading…
Reference in New Issue