M62T vanos support #2243

This commit is contained in:
rusefillc 2021-02-10 19:51:14 -05:00
parent dade25ef34
commit 6416929fbd
2 changed files with 10 additions and 10 deletions

View File

@ -111,7 +111,7 @@ private:
ValueProvider3D *table = nullptr; ValueProvider3D *table = nullptr;
}; };
static AuxPidController instances[AUX_PID_COUNT]; static AuxPidController instances[CAM_INPUTS_COUNT];
static void turnAuxPidOn(int index) { static void turnAuxPidOn(int index) {
if (!isEnabled(index)) { if (!isEnabled(index)) {
@ -130,13 +130,13 @@ static void turnAuxPidOn(int index) {
} }
void startAuxPins() { void startAuxPins() {
for (int i = 0;i <AUX_PID_COUNT;i++) { for (int i = 0;i <CAM_INPUTS_COUNT;i++) {
turnAuxPidOn(i); turnAuxPidOn(i);
} }
} }
void stopAuxPins() { void stopAuxPins() {
for (int i = 0;i < AUX_PID_COUNT;i++) { for (int i = 0;i < CAM_INPUTS_COUNT;i++) {
instances[i].auxOutputPin.deInit(); instances[i].auxOutputPin.deInit();
} }
} }
@ -151,12 +151,12 @@ void initAuxPid(Logging *sharedLogger) {
logger = sharedLogger; logger = sharedLogger;
for (int i = 0;i < AUX_PID_COUNT;i++) { for (int i = 0;i < CAM_INPUTS_COUNT;i++) {
instances[i].init(i); instances[i].init(i);
} }
startAuxPins(); startAuxPins();
for (int i = 0;i < AUX_PID_COUNT;i++) { for (int i = 0;i < CAM_INPUTS_COUNT;i++) {
instances[i].Start(); instances[i].Start();
} }
} }

View File

@ -214,8 +214,8 @@ static void setFsioDigitalInputPin(const char *indexStr, const char *pinName) {
static void setFsioPidOutputPin(const char *indexStr, const char *pinName) { static void setFsioPidOutputPin(const char *indexStr, const char *pinName) {
int index = atoi(indexStr) - 1; int index = atoi(indexStr) - 1;
if (index < 0 || index >= AUX_PID_COUNT) { if (index < 0 || index >= CAM_INPUTS_COUNT) {
scheduleMsg(logger, "invalid AUX index: %d", index); scheduleMsg(logger, "invalid VVT index: %d", index);
return; return;
} }
brain_pin_e pin = parseBrainPin(pinName); brain_pin_e pin = parseBrainPin(pinName);
@ -225,7 +225,7 @@ static void setFsioPidOutputPin(const char *indexStr, const char *pinName) {
return; return;
} }
engineConfiguration->auxPidPins[index] = pin; engineConfiguration->auxPidPins[index] = pin;
scheduleMsg(logger, "FSIO aux pin #%d [%s]", (index + 1), hwPortname(pin)); scheduleMsg(logger, "VVT pid pin #%d [%s]", (index + 1), hwPortname(pin));
} }
static void showFsioInfo(void); static void showFsioInfo(void);
@ -575,10 +575,10 @@ static void showFsioInfo(void) {
showFsio("fan", radiatorFanLogic); showFsio("fan", radiatorFanLogic);
showFsio("alt", alternatorLogic); showFsio("alt", alternatorLogic);
for (int i = 0; i < AUX_PID_COUNT ; i++) { for (int i = 0; i < CAM_INPUTS_COUNT ; i++) {
brain_pin_e pin = engineConfiguration->auxPidPins[i]; brain_pin_e pin = engineConfiguration->auxPidPins[i];
if (isBrainPinValid(pin)) { if (isBrainPinValid(pin)) {
scheduleMsg(logger, "FSIO aux #%d [%s]", (i + 1), scheduleMsg(logger, "VVT pid #%d [%s]", (i + 1),
hwPortname(pin)); hwPortname(pin));
} }