basic hw in the loop - pwm self validation #2028

This commit is contained in:
rusefillc 2020-12-08 05:07:03 -05:00
parent 824f87c2d0
commit 5cda628c8b
2 changed files with 13 additions and 10 deletions

View File

@ -1361,7 +1361,7 @@ void initSettings(void) {
addConsoleActionSS("set_injection_pin", setInjectionPin);
addConsoleActionSS("set_ignition_pin", setIgnitionPin);
addConsoleActionSS(CMD_TRIGGER_PIN, setTriggerInputPin);
addConsoleActionSS("set_trigger_simulator_pin", setTriggerSimulatorPin);
addConsoleActionSS(CMD_TRIGGER_SIMULATOR_PIN, setTriggerSimulatorPin);
addConsoleActionSS("set_egt_cs_pin", (VoidCharPtrCharPtr) setEgtCSPin);
addConsoleActionI("set_egt_spi", setEgtSpi);

View File

@ -196,8 +196,12 @@ void onConfigurationChangeRpmEmulatorCallback(engine_configuration_s *previousCo
void initTriggerEmulator(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
scheduleMsg(sharedLogger, "Emulating %s", getConfigurationName(engineConfiguration->engineType));
for (size_t i = 0; i < efi::size(emulatorOutputs); i++)
{
initTriggerEmulatorLogic(sharedLogger);
}
void startTriggerEmulatorPins() {
hasStimPins = false;
for (size_t i = 0; i < efi::size(emulatorOutputs); i++) {
triggerSignal.outputPins[i] = &emulatorOutputs[i];
brain_pin_e pin = CONFIG(triggerSimulatorPins)[i];
@ -212,16 +216,15 @@ void initTriggerEmulator(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX)
&CONFIG(triggerSimulatorPinModes)[i]);
#endif
}
initTriggerEmulatorLogic(sharedLogger);
}
void startTriggerEmulatorPins() {
}
void stopTriggerEmulatorPins() {
for (size_t i = 0; i < efi::size(emulatorOutputs); i++) {
brain_pin_e brainPin = activeConfiguration.triggerSimulatorPins[i];
if (brainPin != GPIO_UNASSIGNED) {
efiSetPadUnused(brainPin);
}
}
}
#endif /* EFI_EMULATE_POSITION_SENSORS */