auto-sync
This commit is contained in:
parent
2c0b4a7b8c
commit
bd616cba76
|
@ -53,16 +53,17 @@ 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));
|
||||
void showAltInfo(void) {
|
||||
scheduleMsg(logger, "alt=%s @%s t=%dms", boolToString(engineConfiguration->isAlternatorControlEnabled),
|
||||
hwPortname(boardConfiguration->alternatorControlPin),
|
||||
boardConfiguration->alternatorDT);
|
||||
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) {
|
||||
void setAltPFactor(float p) {
|
||||
engineConfiguration->alternatorControlPFactor = p;
|
||||
scheduleMsg(logger, "setAltPid: %f", p);
|
||||
applySettings();
|
||||
|
|
|
@ -12,5 +12,7 @@
|
|||
|
||||
#include "main.h"
|
||||
void initAlternatorCtrl(Logging *sharedLogger);
|
||||
void setAltPFactor(float p);
|
||||
void showAltInfo(void);
|
||||
|
||||
#endif /* ALTERNATORCONTROLLER_H_ */
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "engine.h"
|
||||
#include "efiGpio.h"
|
||||
#include "engine_math.h"
|
||||
#include "alternatorController.h"
|
||||
|
||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||
#include "rusefi.h"
|
||||
|
@ -922,12 +923,20 @@ static void setInjectorLag(float value) {
|
|||
}
|
||||
|
||||
static void setValue(const char *paramStr, const char *valueStr) {
|
||||
float value = atoff(valueStr);
|
||||
float valueF = atoff(valueStr);
|
||||
int valueI = atoi(valueStr);
|
||||
|
||||
if (strEqualCaseInsensitive(paramStr, "vsscoeff")) {
|
||||
engineConfiguration->vehicleSpeedCoef = value;
|
||||
engineConfiguration->vehicleSpeedCoef = valueF;
|
||||
} else if (strEqualCaseInsensitive(paramStr, "alt_t")) {
|
||||
if (valueI > 10) {
|
||||
boardConfiguration->alternatorDT = valueI;
|
||||
}
|
||||
showAltInfo();
|
||||
} else if (strEqualCaseInsensitive(paramStr, "alt_p")) {
|
||||
setAltPFactor(valueF);
|
||||
} else if (strEqualCaseInsensitive(paramStr, "targetvbatt")) {
|
||||
boardConfiguration->targetVBatt = value;
|
||||
boardConfiguration->targetVBatt = valueF;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -290,5 +290,5 @@ int getRusEfiVersion(void) {
|
|||
return 123; // this is here to make the compiler happy about the unused array
|
||||
if (UNUSED_CCM_SIZE[0] * 0 != 0)
|
||||
return 3211; // this is here to make the compiler happy about the unused array
|
||||
return 20150512;
|
||||
return 20150514;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue