Starter is engaged on start-up in pull-up configuration #1969

This commit is contained in:
rusefillc 2020-11-26 17:48:09 -05:00
parent fb0863a1be
commit 641959b9a3
3 changed files with 17 additions and 1 deletions

View File

@ -79,6 +79,7 @@ class Engine final : public TriggerStateListener {
public:
explicit Engine(persistent_config_s *config);
Engine();
bool isPwmEnabled = true;
IEtbController *etbControllers[ETB_COUNT] = {nullptr};
IFuelComputer *fuelComputer = nullptr;

View File

@ -898,6 +898,8 @@ static void enableOrDisable(const char *param, bool isEnabled) {
engineConfiguration->canWriteEnabled = isEnabled;
} else if (strEqualCaseInsensitive(param, CMD_INJECTION)) {
engineConfiguration->isInjectionEnabled = isEnabled;
} else if (strEqualCaseInsensitive(param, CMD_PWM)) {
engine->isPwmEnabled = isEnabled;
} else if (strEqualCaseInsensitive(param, "trigger_details")) {
engineConfiguration->verboseTriggerSynchDetails = isEnabled;
} else if (strEqualCaseInsensitive(param, "vvt_details")) {

View File

@ -13,9 +13,12 @@
#include "pwm_generator_logic.h"
#include "perf_trace.h"
EXTERN_ENGINE;
#if EFI_PROD_CODE
#include "mpu_util.h"
#endif
#include "engine.h"
#endif // EFI_PROD_CODE
// 1% duty cycle
#define ZERO_PWM_THRESHOLD 0.01
@ -375,6 +378,16 @@ void startSimplePwmHard(SimplePwm *state, const char *msg,
* This method takes ~350 ticks.
*/
void applyPinState(int stateIndex, PwmConfig *state) /* pwm_gen_callback */ {
#if EFI_PROD_CODE
if (!engine->isPwmEnabled) {
for (int channelIndex = 0; channelIndex < state->multiChannelStateSequence.waveCount; channelIndex++) {
OutputPin *output = state->outputPins[channelIndex];
output->setValue(0);
}
return;
}
#endif // EFI_PROD_CODE
efiAssertVoid(CUSTOM_ERR_6663, stateIndex < PWM_PHASE_MAX_COUNT, "invalid stateIndex");
efiAssertVoid(CUSTOM_ERR_6664, state->multiChannelStateSequence.waveCount <= PWM_PHASE_MAX_WAVE_PER_PWM, "invalid waveCount");
for (int channelIndex = 0; channelIndex < state->multiChannelStateSequence.waveCount; channelIndex++) {