evil manual merge of https://github.com/DonaldBecker/rusefi
This commit is contained in:
parent
a41b4c896d
commit
2530f31498
|
@ -37,7 +37,7 @@ public:
|
||||||
// F4 does not care
|
// F4 does not care
|
||||||
__ALIGNED(32) adcsample_t samples[ADC_MAX_CHANNELS_COUNT * MAX_ADC_GRP_BUF_DEPTH];
|
__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
|
// 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;
|
int getAdcValueByHwChannel(int hwChannel) const;
|
||||||
|
|
||||||
|
|
|
@ -305,11 +305,13 @@ void setCanType(int type) {
|
||||||
canInfo();
|
canInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(EFI_TUNER_STUDIO)
|
||||||
void postCanState(TunerStudioOutputChannels *tsOutputChannels) {
|
void postCanState(TunerStudioOutputChannels *tsOutputChannels) {
|
||||||
tsOutputChannels->debugIntField1 = isCanEnabled ? canReadCounter : -1;
|
tsOutputChannels->debugIntField1 = isCanEnabled ? canReadCounter : -1;
|
||||||
tsOutputChannels->debugIntField2 = isCanEnabled ? canWriteOk : -1;
|
tsOutputChannels->debugIntField2 = isCanEnabled ? canWriteOk : -1;
|
||||||
tsOutputChannels->debugIntField3 = isCanEnabled ? canWriteNotOk : -1;
|
tsOutputChannels->debugIntField3 = isCanEnabled ? canWriteNotOk : -1;
|
||||||
}
|
}
|
||||||
|
#endif /* EFI_TUNER_STUDIO */
|
||||||
|
|
||||||
void enableFrankensoCan(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
void enableFrankensoCan(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
CONFIGB(canTxPin) = GPIOB_6;
|
CONFIGB(canTxPin) = GPIOB_6;
|
||||||
|
|
|
@ -5,8 +5,7 @@
|
||||||
* @author Andrey Belomutskiy, (c) 2012-2019
|
* @author Andrey Belomutskiy, (c) 2012-2019
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CAN_HW_H_
|
#pragma once
|
||||||
#define CAN_HW_H_
|
|
||||||
|
|
||||||
#include "efifeatures.h"
|
#include "efifeatures.h"
|
||||||
#if EFI_TUNER_STUDIO
|
#if EFI_TUNER_STUDIO
|
||||||
|
@ -48,7 +47,9 @@ void setTxBit(int offset, int index);
|
||||||
void stopCanPins(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
void stopCanPins(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||||
void startCanPins(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
void startCanPins(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||||
void enableFrankensoCan(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
void enableFrankensoCan(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||||
|
#if defined(EFI_TUNER_STUDIO)
|
||||||
void postCanState(TunerStudioOutputChannels *tsOutputChannels);
|
void postCanState(TunerStudioOutputChannels *tsOutputChannels);
|
||||||
#endif
|
#endif /* EFI_TUNER_STUDIO */
|
||||||
|
#endif /* EFI_CAN_SUPPORT */
|
||||||
|
|
||||||
|
|
||||||
#endif /* CAN_HW_H_ */
|
|
||||||
|
|
|
@ -143,20 +143,21 @@ void StepperMotor::setDirection(bool isIncrementing) {
|
||||||
|
|
||||||
void StepperMotor::pulse() {
|
void StepperMotor::pulse() {
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
palWritePad(enablePort, enablePin, false); // enable stepper
|
palWritePad(enablePort, enablePin, 0); // enable stepper
|
||||||
palWritePad(stepPort, stepPin, true);
|
palWritePad(stepPort, stepPin, 1);
|
||||||
chThdSleepMilliseconds(reactionTime);
|
chThdSleepMilliseconds(reactionTime);
|
||||||
|
|
||||||
palWritePad(stepPort, stepPin, false);
|
palWritePad(stepPort, stepPin, 0);
|
||||||
chThdSleepMilliseconds(reactionTime);
|
chThdSleepMilliseconds(reactionTime);
|
||||||
|
|
||||||
palWritePad(enablePort, enablePin, true); // disable stepper
|
palWritePad(enablePort, enablePin, 1); // disable stepper
|
||||||
#endif
|
#endif /* EFI_PROD_CODE */
|
||||||
}
|
}
|
||||||
|
|
||||||
void StepperMotor::initialize(brain_pin_e stepPin, brain_pin_e directionPin, pin_output_mode_e directionPinMode,
|
void StepperMotor::initialize(brain_pin_e stepPin, brain_pin_e directionPin, pin_output_mode_e directionPinMode,
|
||||||
float reactionTime, int totalSteps,
|
float reactionTime, int totalSteps,
|
||||||
brain_pin_e enablePin, pin_output_mode_e enablePinMode, Logging *sharedLogger) {
|
brain_pin_e enablePin, pin_output_mode_e enablePinMode, Logging *sharedLogger) {
|
||||||
|
UNUSED(enablePinMode);
|
||||||
this->reactionTime = maxF(1, reactionTime);
|
this->reactionTime = maxF(1, reactionTime);
|
||||||
this->totalSteps = maxI(3, totalSteps);
|
this->totalSteps = maxI(3, totalSteps);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue