This commit is contained in:
rusefi 2019-11-06 20:01:53 -05:00
parent ae0456e5fb
commit 962a879a7d
4 changed files with 14 additions and 10 deletions

View File

@ -37,7 +37,7 @@ public:
// F4 does not care
__ALIGNED(32) adcsample_t samples[ADC_MAX_CHANNELS_COUNT * MAX_ADC_GRP_BUF_DEPTH];
// Assert multiple of 32 bytes long so we don't stomp on the data after the buffer
static_assert(sizeof(samples) % 32 == 0);
static_assert(sizeof(samples) % 32 == 0, "ADC sample buffer alignment");
int getAdcValueByHwChannel(int hwChannel) const;

View File

@ -305,11 +305,13 @@ void setCanType(int type) {
canInfo();
}
#if defined(EFI_TUNER_STUDIO)
void postCanState(TunerStudioOutputChannels *tsOutputChannels) {
tsOutputChannels->debugIntField1 = isCanEnabled ? canReadCounter : -1;
tsOutputChannels->debugIntField2 = isCanEnabled ? canWriteOk : -1;
tsOutputChannels->debugIntField3 = isCanEnabled ? canWriteNotOk : -1;
}
#endif /* EFI_TUNER_STUDIO */
void enableFrankensoCan(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
CONFIGB(canTxPin) = GPIOB_6;

View File

@ -5,8 +5,7 @@
* @author Andrey Belomutskiy, (c) 2012-2019
*/
#ifndef CAN_HW_H_
#define CAN_HW_H_
#pragma once
#include "efifeatures.h"
#if EFI_TUNER_STUDIO
@ -48,7 +47,9 @@ void setTxBit(int offset, int index);
void stopCanPins(DECLARE_ENGINE_PARAMETER_SIGNATURE);
void startCanPins(DECLARE_ENGINE_PARAMETER_SIGNATURE);
void enableFrankensoCan(DECLARE_ENGINE_PARAMETER_SIGNATURE);
#if defined(EFI_TUNER_STUDIO)
void postCanState(TunerStudioOutputChannels *tsOutputChannels);
#endif
#endif /* EFI_TUNER_STUDIO */
#endif /* EFI_CAN_SUPPORT */
#endif /* CAN_HW_H_ */

View File

@ -143,20 +143,21 @@ void StepperMotor::setDirection(bool isIncrementing) {
void StepperMotor::pulse() {
#if EFI_PROD_CODE
palWritePad(enablePort, enablePin, false); // enable stepper
palWritePad(stepPort, stepPin, true);
palWritePad(enablePort, enablePin, 0); // enable stepper
palWritePad(stepPort, stepPin, 1);
chThdSleepMilliseconds(reactionTime);
palWritePad(stepPort, stepPin, false);
palWritePad(stepPort, stepPin, 0);
chThdSleepMilliseconds(reactionTime);
palWritePad(enablePort, enablePin, true); // disable stepper
#endif
palWritePad(enablePort, enablePin, 1); // disable stepper
#endif /* EFI_PROD_CODE */
}
void StepperMotor::initialize(brain_pin_e stepPin, brain_pin_e directionPin, pin_output_mode_e directionPinMode,
float reactionTime, int totalSteps,
brain_pin_e enablePin, pin_output_mode_e enablePinMode, Logging *sharedLogger) {
UNUSED(enablePinMode);
this->reactionTime = maxF(1, reactionTime);
this->totalSteps = maxI(3, totalSteps);