diff --git a/firmware/controllers/injector_central.cpp b/firmware/controllers/injector_central.cpp index 476289c2f2..5e9e0405e2 100644 --- a/firmware/controllers/injector_central.cpp +++ b/firmware/controllers/injector_central.cpp @@ -239,7 +239,7 @@ void initInjectorCentral(Engine *engine) { // todo: should we move this code closer to the injection logic? for (int i = 0; i < engineConfiguration->cylindersCount; i++) { - NamedOutputPin *output = &enginePins.coils[i]; + NamedOutputPin *output = &enginePins.injectors[i]; outputPinRegisterExt2(output->name, output, boardConfiguration->injectionPins[i], &boardConfiguration->injectionPinMode); diff --git a/firmware/controllers/system/pwm_generator_logic.cpp b/firmware/controllers/system/pwm_generator_logic.cpp index eb0a0a1b3b..c878735e36 100644 --- a/firmware/controllers/system/pwm_generator_logic.cpp +++ b/firmware/controllers/system/pwm_generator_logic.cpp @@ -43,7 +43,7 @@ void SimplePwm::setSimplePwmDutyCycle(float dutyCycle) { multiWave.setSwitchTime(0, dutyCycle); } -static uint64_t getNextSwitchTimeUs(PwmConfig *state) { +static efitimeus_t getNextSwitchTimeUs(PwmConfig *state) { efiAssert(state->safe.phaseIndex < PWM_PHASE_MAX_COUNT, "phaseIndex range", 0); int iteration = state->safe.iteration; float switchTime = state->multiWave.getSwitchTime(state->safe.phaseIndex); @@ -87,7 +87,7 @@ void PwmConfig::handleCycleStart() { /** * @return Next time for signal toggle */ -static uint64_t togglePwmState(PwmConfig *state) { +static efitimeus_t togglePwmState(PwmConfig *state) { #if DEBUG_PWM scheduleMsg(&logger, "togglePwmState phaseIndex=%d iteration=%d", state->safe.phaseIndex, state->safe.iteration); scheduleMsg(&logger, "state->period=%f state->safe.period=%f", state->period, state->safe.period); @@ -109,7 +109,7 @@ static uint64_t togglePwmState(PwmConfig *state) { int cbStateIndex = state->safe.phaseIndex == 0 ? state->phaseCount - 1 : state->safe.phaseIndex - 1; state->stateChangeCallback(state, cbStateIndex); - uint64_t nextSwitchTimeUs = getNextSwitchTimeUs(state); + efitimeus_t nextSwitchTimeUs = getNextSwitchTimeUs(state); #if DEBUG_PWM scheduleMsg(&logger, "%s: nextSwitchTime %d", state->name, nextSwitchTime); #endif @@ -140,7 +140,7 @@ static uint64_t togglePwmState(PwmConfig *state) { * Main PWM loop: toggle pin & schedule next invocation */ static void timerCallback(PwmConfig *state) { - uint64_t switchTimeUs = togglePwmState(state); + efitimeus_t switchTimeUs = togglePwmState(state); scheduleTask2("pwm", &state->scheduling, switchTimeUs, (schfunc_t) timerCallback, state); } diff --git a/firmware/hw_layer/adc_inputs.cpp b/firmware/hw_layer/adc_inputs.cpp index 6a9a13240b..ec89015f6d 100644 --- a/firmware/hw_layer/adc_inputs.cpp +++ b/firmware/hw_layer/adc_inputs.cpp @@ -53,8 +53,10 @@ AdcConfiguration::AdcConfiguration(ADCConversionGroup* hwConfig) { #define PWM_FREQ_FAST 100000 /* PWM clock frequency. I wonder what does this setting mean? */ #define PWM_PERIOD_FAST 10 /* PWM period (in PWM ticks). */ +// is there a reason to have this configurable? #define ADC_SLOW_DEVICE ADCD1 +// is there a reason to have this configurable? #define ADC_FAST_DEVICE ADCD2 static char LOGGING_BUFFER[500]; diff --git a/firmware/hw_layer/gpio_helper.cpp b/firmware/hw_layer/gpio_helper.cpp index 7349818d69..53977053e0 100644 --- a/firmware/hw_layer/gpio_helper.cpp +++ b/firmware/hw_layer/gpio_helper.cpp @@ -36,7 +36,7 @@ void initOutputPinExt(const char *msg, OutputPin *outputPin, GPIO_TypeDef *port, * here we check if another physical pin is already assigned to this logical output */ // todo: need to clear '&outputs' in io_pins.c - firmwareError("outputPin already assigned to %x%d", outputPin->port, outputPin->pin); + firmwareError("outputPin [%s] already assigned to %x%d", msg, outputPin->port, outputPin->pin); return; } outputPin->currentLogicValue = INITIAL_PIN_STATE;