auto-sync

This commit is contained in:
rusEfi 2015-04-15 10:05:24 -04:00
parent 47c1fca16f
commit 8d525e8ed1
6 changed files with 17 additions and 16 deletions

View File

@ -403,10 +403,6 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
engineConfiguration->canNbcType = CAN_BUS_NBC_BMW;
// engineConfiguration->canNbcType = CAN_BUS_MAZDA_RX8;
boardConfiguration->idle.stepperDirectionPin = GPIOE_10;
boardConfiguration->idle.stepperStepPin = GPIOE_12;
engineConfiguration->mapAccelLength = 12;
}

View File

@ -397,6 +397,12 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
boardConfiguration->useSerialPort = true;
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
engineConfiguration->digitalChartSize = 300;
#else
@ -591,12 +597,6 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
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->mapAccelEnrichmentThreshold = 5; // kPa
engineConfiguration->mapAccelEnrichmentMultiplier = 2;

View File

@ -68,6 +68,7 @@ static void showIdleInfo(void) {
engineConfiguration->idleStepperReactionTime);
scheduleMsg(logger, "step=%s steps=%d", hwPortname(boardConfiguration->idle.stepperStepPin),
engineConfiguration->idleStepperTotalSteps);
scheduleMsg(logger, "enable=%s", hwPortname(engineConfiguration->stepperEnablePin));
} else {
scheduleMsg(logger, "idle valve freq=%d on %s", boardConfiguration->idle.solenoidFrequency,
hwPortname(boardConfiguration->idle.solenoidPin));
@ -175,7 +176,8 @@ void startIdleThread(Logging*sharedLogger, Engine *engine) {
if (boardConfiguration->useStepperIdle) {
iacMotor.initialize(boardConfiguration->idle.stepperStepPin, boardConfiguration->idle.stepperDirectionPin,
engineConfiguration->idleStepperReactionTime, engineConfiguration->idleStepperTotalSteps);
engineConfiguration->idleStepperReactionTime, engineConfiguration->idleStepperTotalSteps,
engineConfiguration->stepperEnablePin);
} else {
/**
* Start PWM for idleValvePin

View File

@ -74,7 +74,8 @@ void StepperMotor::pulse() {
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->totalSteps = maxI(3, totalSteps);
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);
this->directionPin = getHwPin(directionPin);
mySetPadMode2("st step", stepPin, PAL_MODE_OUTPUT_PUSHPULL);
mySetPadMode2("st dir", directionPin, PAL_MODE_OUTPUT_PUSHPULL);
mySetPadMode2("stepper step", stepPin, 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);
}

View File

@ -12,7 +12,8 @@
class StepperMotor {
public:
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 setTargetPosition(int targetPosition);
int getTargetPosition();

View File

@ -290,5 +290,5 @@ int getRusEfiVersion(void) {
return 123; // this is here to make the compiler happy about the unused array
if (UNUSED_CCM_SIZE[0] * 0 != 0)
return 3211; // this is here to make the compiler happy about the unused array
return 20150414;
return 20150415;
}