refactoring
This commit is contained in:
parent
7c39715483
commit
4df9e89afd
|
@ -100,9 +100,9 @@ static void setIdleValvePwm(percent_t value) {
|
||||||
idleSolenoid.setSimplePwmDutyCycle(value / 100);
|
idleSolenoid.setSimplePwmDutyCycle(value / 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void manualIdleController(int positionPercent) {
|
static void manualIdleController() {
|
||||||
// todo: this is not great that we have to write into configuration here
|
|
||||||
boardConfiguration->manIdlePosition = positionPercent;
|
int positionPercent = boardConfiguration->manIdlePosition;
|
||||||
|
|
||||||
if (isCranking()) {
|
if (isCranking()) {
|
||||||
positionPercent += engineConfiguration->crankingIdleAdjustment;
|
positionPercent += engineConfiguration->crankingIdleAdjustment;
|
||||||
|
@ -137,7 +137,9 @@ void setIdleValvePosition(int positionPercent) {
|
||||||
return;
|
return;
|
||||||
scheduleMsg(logger, "setting idle valve position %d", positionPercent);
|
scheduleMsg(logger, "setting idle valve position %d", positionPercent);
|
||||||
showIdleInfo();
|
showIdleInfo();
|
||||||
manualIdleController(positionPercent);
|
// todo: this is not great that we have to write into configuration here
|
||||||
|
boardConfiguration->manIdlePosition = positionPercent;
|
||||||
|
manualIdleController();
|
||||||
}
|
}
|
||||||
|
|
||||||
static int idlePositionBeforeBlip;
|
static int idlePositionBeforeBlip;
|
||||||
|
@ -221,7 +223,7 @@ static msg_t ivThread(int param) {
|
||||||
|
|
||||||
if (engineConfiguration->idleMode == IM_MANUAL) {
|
if (engineConfiguration->idleMode == IM_MANUAL) {
|
||||||
// let's re-apply CLT correction
|
// let's re-apply CLT correction
|
||||||
manualIdleController(boardConfiguration->manIdlePosition);
|
manualIdleController();
|
||||||
} else {
|
} else {
|
||||||
autoIdle();
|
autoIdle();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue