auto-sync
This commit is contained in:
parent
df837a8746
commit
157403ffe8
|
@ -53,10 +53,20 @@ static void applySettings(void) {
|
|||
altPid.updateFactors(engineConfiguration->alternatorControlPFactor, 0, 0);
|
||||
}
|
||||
|
||||
static void showAltInfo(void) {
|
||||
scheduleMsg(logger, "alt=%s @ %s", boolToString(engineConfiguration->isAlternatorControlEnabled),
|
||||
hwPortname(boardConfiguration->alternatorControlPin));
|
||||
scheduleMsg(logger, "p=%f/i=%f/d=%f", engineConfiguration->alternatorControlPFactor,
|
||||
0, 0); // todo: i & d
|
||||
scheduleMsg(logger, "vbatt=%f/duty=%f/target=%f", getVBatt(engineConfiguration), currentAltDuty,
|
||||
boardConfiguration->targetVBatt);
|
||||
}
|
||||
|
||||
static void setAltPFactor(float p) {
|
||||
engineConfiguration->alternatorControlPFactor = p;
|
||||
scheduleMsg(logger, "setAltPid: %f", p);
|
||||
applySettings();
|
||||
showAltInfo();
|
||||
}
|
||||
|
||||
static void applyAlternatorPinState(PwmConfig *state, int stateIndex) {
|
||||
|
@ -68,15 +78,6 @@ static void applyAlternatorPinState(PwmConfig *state, int stateIndex) {
|
|||
output->setValue(value);
|
||||
}
|
||||
|
||||
static void showAltInfo(void) {
|
||||
scheduleMsg(logger, "alt=%s @ %s", boolToString(engineConfiguration->isAlternatorControlEnabled),
|
||||
hwPortname(boardConfiguration->alternatorControlPin));
|
||||
scheduleMsg(logger, "p=%f/i=%f/d=%f", engineConfiguration->alternatorControlPFactor,
|
||||
0, 0); // todo: i & d
|
||||
scheduleMsg(logger, "vbatt=%f/duty=%f/target=%f", getVBatt(engineConfiguration), currentAltDuty,
|
||||
boardConfiguration->targetVBatt);
|
||||
}
|
||||
|
||||
void initAlternatorCtrl(Logging *sharedLogger) {
|
||||
logger = sharedLogger;
|
||||
if (boardConfiguration->alternatorControlPin == GPIO_UNASSIGNED)
|
||||
|
|
Loading…
Reference in New Issue