mirror of https://github.com/rusefi/rusefi-1.git
auto-sync
This commit is contained in:
parent
47c1fca16f
commit
8d525e8ed1
|
@ -403,10 +403,6 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||||
engineConfiguration->canNbcType = CAN_BUS_NBC_BMW;
|
engineConfiguration->canNbcType = CAN_BUS_NBC_BMW;
|
||||||
// engineConfiguration->canNbcType = CAN_BUS_MAZDA_RX8;
|
// engineConfiguration->canNbcType = CAN_BUS_MAZDA_RX8;
|
||||||
|
|
||||||
|
|
||||||
boardConfiguration->idle.stepperDirectionPin = GPIOE_10;
|
|
||||||
boardConfiguration->idle.stepperStepPin = GPIOE_12;
|
|
||||||
|
|
||||||
engineConfiguration->mapAccelLength = 12;
|
engineConfiguration->mapAccelLength = 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -397,6 +397,12 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||||
boardConfiguration->useSerialPort = true;
|
boardConfiguration->useSerialPort = true;
|
||||||
boardConfiguration->useStepperIdle = false;
|
boardConfiguration->useStepperIdle = false;
|
||||||
|
|
||||||
|
boardConfiguration->idle.stepperDirectionPin = GPIOE_10;
|
||||||
|
boardConfiguration->idle.stepperStepPin = GPIOE_12;
|
||||||
|
engineConfiguration->stepperEnablePin = GPIOE_14;
|
||||||
|
engineConfiguration->idleStepperReactionTime = 10;
|
||||||
|
engineConfiguration->idleStepperTotalSteps = 150;
|
||||||
|
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
engineConfiguration->digitalChartSize = 300;
|
engineConfiguration->digitalChartSize = 300;
|
||||||
#else
|
#else
|
||||||
|
@ -591,12 +597,6 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||||
|
|
||||||
boardConfiguration->tunerStudioSerialSpeed = TS_DEFAULT_SPEED;
|
boardConfiguration->tunerStudioSerialSpeed = TS_DEFAULT_SPEED;
|
||||||
|
|
||||||
boardConfiguration->idle.stepperStepPin = GPIO_UNASSIGNED;
|
|
||||||
boardConfiguration->idle.stepperDirectionPin = GPIO_UNASSIGNED;
|
|
||||||
|
|
||||||
engineConfiguration->idleStepperReactionTime = 10;
|
|
||||||
engineConfiguration->idleStepperTotalSteps = 150;
|
|
||||||
|
|
||||||
engineConfiguration->mapAccelLength = 6;
|
engineConfiguration->mapAccelLength = 6;
|
||||||
engineConfiguration->mapAccelEnrichmentThreshold = 5; // kPa
|
engineConfiguration->mapAccelEnrichmentThreshold = 5; // kPa
|
||||||
engineConfiguration->mapAccelEnrichmentMultiplier = 2;
|
engineConfiguration->mapAccelEnrichmentMultiplier = 2;
|
||||||
|
|
|
@ -68,6 +68,7 @@ static void showIdleInfo(void) {
|
||||||
engineConfiguration->idleStepperReactionTime);
|
engineConfiguration->idleStepperReactionTime);
|
||||||
scheduleMsg(logger, "step=%s steps=%d", hwPortname(boardConfiguration->idle.stepperStepPin),
|
scheduleMsg(logger, "step=%s steps=%d", hwPortname(boardConfiguration->idle.stepperStepPin),
|
||||||
engineConfiguration->idleStepperTotalSteps);
|
engineConfiguration->idleStepperTotalSteps);
|
||||||
|
scheduleMsg(logger, "enable=%s", hwPortname(engineConfiguration->stepperEnablePin));
|
||||||
} else {
|
} else {
|
||||||
scheduleMsg(logger, "idle valve freq=%d on %s", boardConfiguration->idle.solenoidFrequency,
|
scheduleMsg(logger, "idle valve freq=%d on %s", boardConfiguration->idle.solenoidFrequency,
|
||||||
hwPortname(boardConfiguration->idle.solenoidPin));
|
hwPortname(boardConfiguration->idle.solenoidPin));
|
||||||
|
@ -175,7 +176,8 @@ void startIdleThread(Logging*sharedLogger, Engine *engine) {
|
||||||
|
|
||||||
if (boardConfiguration->useStepperIdle) {
|
if (boardConfiguration->useStepperIdle) {
|
||||||
iacMotor.initialize(boardConfiguration->idle.stepperStepPin, boardConfiguration->idle.stepperDirectionPin,
|
iacMotor.initialize(boardConfiguration->idle.stepperStepPin, boardConfiguration->idle.stepperDirectionPin,
|
||||||
engineConfiguration->idleStepperReactionTime, engineConfiguration->idleStepperTotalSteps);
|
engineConfiguration->idleStepperReactionTime, engineConfiguration->idleStepperTotalSteps,
|
||||||
|
engineConfiguration->stepperEnablePin);
|
||||||
} else {
|
} else {
|
||||||
/**
|
/**
|
||||||
* Start PWM for idleValvePin
|
* Start PWM for idleValvePin
|
||||||
|
|
|
@ -74,7 +74,8 @@ void StepperMotor::pulse() {
|
||||||
chThdSleepMilliseconds(ST_DELAY_MS);
|
chThdSleepMilliseconds(ST_DELAY_MS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void StepperMotor::initialize(brain_pin_e stepPin, brain_pin_e directionPin, float reactionTime, int totalSteps) {
|
void StepperMotor::initialize(brain_pin_e stepPin, brain_pin_e directionPin, float reactionTime, int totalSteps,
|
||||||
|
brain_pin_e enablePin) {
|
||||||
this->reactionTime = maxF(1, reactionTime);
|
this->reactionTime = maxF(1, reactionTime);
|
||||||
this->totalSteps = maxI(3, totalSteps);
|
this->totalSteps = maxI(3, totalSteps);
|
||||||
if (stepPin == GPIO_UNASSIGNED || directionPin == GPIO_UNASSIGNED) {
|
if (stepPin == GPIO_UNASSIGNED || directionPin == GPIO_UNASSIGNED) {
|
||||||
|
@ -87,8 +88,9 @@ void StepperMotor::initialize(brain_pin_e stepPin, brain_pin_e directionPin, flo
|
||||||
directionPort = getHwPort(directionPin);
|
directionPort = getHwPort(directionPin);
|
||||||
this->directionPin = getHwPin(directionPin);
|
this->directionPin = getHwPin(directionPin);
|
||||||
|
|
||||||
mySetPadMode2("st step", stepPin, PAL_MODE_OUTPUT_PUSHPULL);
|
mySetPadMode2("stepper step", stepPin, PAL_MODE_OUTPUT_PUSHPULL);
|
||||||
mySetPadMode2("st dir", directionPin, PAL_MODE_OUTPUT_PUSHPULL);
|
mySetPadMode2("stepper dir", directionPin, PAL_MODE_OUTPUT_PUSHPULL);
|
||||||
|
mySetPadMode2("stepper enable", enablePin, PAL_MODE_OUTPUT_PUSHPULL);
|
||||||
|
|
||||||
chThdCreateStatic(stThreadStack, sizeof(stThreadStack), NORMALPRIO, (tfunc_t) stThread, this);
|
chThdCreateStatic(stThreadStack, sizeof(stThreadStack), NORMALPRIO, (tfunc_t) stThread, this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,8 @@
|
||||||
class StepperMotor {
|
class StepperMotor {
|
||||||
public:
|
public:
|
||||||
StepperMotor();
|
StepperMotor();
|
||||||
void initialize(brain_pin_e stepPin, brain_pin_e directionPin, float reactionTime, int totalSteps);
|
void initialize(brain_pin_e stepPin, brain_pin_e directionPin, float reactionTime, int totalSteps,
|
||||||
|
brain_pin_e enablePin);
|
||||||
void pulse();
|
void pulse();
|
||||||
void setTargetPosition(int targetPosition);
|
void setTargetPosition(int targetPosition);
|
||||||
int getTargetPosition();
|
int getTargetPosition();
|
||||||
|
|
|
@ -290,5 +290,5 @@ int getRusEfiVersion(void) {
|
||||||
return 123; // this is here to make the compiler happy about the unused array
|
return 123; // this is here to make the compiler happy about the unused array
|
||||||
if (UNUSED_CCM_SIZE[0] * 0 != 0)
|
if (UNUSED_CCM_SIZE[0] * 0 != 0)
|
||||||
return 3211; // this is here to make the compiler happy about the unused array
|
return 3211; // this is here to make the compiler happy about the unused array
|
||||||
return 20150414;
|
return 20150415;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue