progress - pin management
This commit is contained in:
parent
41d73f7251
commit
81d3c1679b
|
@ -149,15 +149,14 @@ void setDefaultEtbParameters(void) {
|
||||||
boardConfiguration->etbDT = 100;
|
boardConfiguration->etbDT = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
void initElectronicThrottle(void) {
|
void stopETBPins(void) {
|
||||||
// these two lines are controlling direction
|
unmarkPin(boardConfiguration->etbControlPin1);
|
||||||
// outputPinRegister("etb1", ELECTRONIC_THROTTLE_CONTROL_1, ETB_CONTROL_LINE_1_PORT, ETB_CONTROL_LINE_1_PIN);
|
unmarkPin(boardConfiguration->etbControlPin2);
|
||||||
// outputPinRegister("etb2", ELECTRONIC_THROTTLE_CONTROL_2, ETB_CONTROL_LINE_2_PORT, ETB_CONTROL_LINE_2_PIN);
|
unmarkPin(boardConfiguration->etbDirectionPin1);
|
||||||
|
unmarkPin(boardConfiguration->etbDirectionPin2);
|
||||||
if (!hasPedalPositionSensor()) {
|
}
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
void startETBPins(void) {
|
||||||
// this line used for PWM
|
// this line used for PWM
|
||||||
startSimplePwmExt(&etbPwmUp, "etb1",
|
startSimplePwmExt(&etbPwmUp, "etb1",
|
||||||
boardConfiguration->etbControlPin1,
|
boardConfiguration->etbControlPin1,
|
||||||
|
@ -174,6 +173,18 @@ void initElectronicThrottle(void) {
|
||||||
|
|
||||||
outputPinRegisterExt2("etb dir open", &outputDirectionOpen, boardConfiguration->etbDirectionPin1, &DEFAULT_OUTPUT);
|
outputPinRegisterExt2("etb dir open", &outputDirectionOpen, boardConfiguration->etbDirectionPin1, &DEFAULT_OUTPUT);
|
||||||
outputPinRegisterExt2("etb dir close", &outputDirectionClose, boardConfiguration->etbDirectionPin2, &DEFAULT_OUTPUT);
|
outputPinRegisterExt2("etb dir close", &outputDirectionClose, boardConfiguration->etbDirectionPin2, &DEFAULT_OUTPUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
void initElectronicThrottle(void) {
|
||||||
|
// these two lines are controlling direction
|
||||||
|
// outputPinRegister("etb1", ELECTRONIC_THROTTLE_CONTROL_1, ETB_CONTROL_LINE_1_PORT, ETB_CONTROL_LINE_1_PIN);
|
||||||
|
// outputPinRegister("etb2", ELECTRONIC_THROTTLE_CONTROL_2, ETB_CONTROL_LINE_2_PORT, ETB_CONTROL_LINE_2_PIN);
|
||||||
|
|
||||||
|
if (!hasPedalPositionSensor()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
startETBPins();
|
||||||
|
|
||||||
addConsoleActionI("e", setThrottleConsole);
|
addConsoleActionI("e", setThrottleConsole);
|
||||||
|
|
||||||
|
|
|
@ -12,5 +12,7 @@ void initElectronicThrottle(void);
|
||||||
void setDefaultEtbParameters(void);
|
void setDefaultEtbParameters(void);
|
||||||
void setEtbPFactor(float value);
|
void setEtbPFactor(float value);
|
||||||
void setEtbIFactor(float value);
|
void setEtbIFactor(float value);
|
||||||
|
void stopETBPins(void);
|
||||||
|
void startETBPins(void);
|
||||||
|
|
||||||
#endif /* ELECTRONIC_THROTTLE_H_ */
|
#endif /* ELECTRONIC_THROTTLE_H_ */
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
#include "AdcConfiguration.h"
|
#include "AdcConfiguration.h"
|
||||||
|
#include "electronic_throttle.h"
|
||||||
#include "board_test.h"
|
#include "board_test.h"
|
||||||
#include "mcp3208.h"
|
#include "mcp3208.h"
|
||||||
#include "HIP9011.h"
|
#include "HIP9011.h"
|
||||||
|
@ -229,6 +230,7 @@ void applyNewHardwareSettings(void) {
|
||||||
stopInjectionPins();
|
stopInjectionPins();
|
||||||
stopIgnitionPins();
|
stopIgnitionPins();
|
||||||
stopCanPins();
|
stopCanPins();
|
||||||
|
stopETBPins();
|
||||||
|
|
||||||
if (engineConfiguration->bc.is_enabled_spi_1 != activeConfiguration.bc.is_enabled_spi_1)
|
if (engineConfiguration->bc.is_enabled_spi_1 != activeConfiguration.bc.is_enabled_spi_1)
|
||||||
stopSpi(SPI_DEVICE_1);
|
stopSpi(SPI_DEVICE_1);
|
||||||
|
@ -285,6 +287,7 @@ void applyNewHardwareSettings(void) {
|
||||||
startInjectionPins();
|
startInjectionPins();
|
||||||
startIgnitionPins();
|
startIgnitionPins();
|
||||||
startCanPins();
|
startCanPins();
|
||||||
|
startETBPins();
|
||||||
|
|
||||||
adcConfigListener(engine);
|
adcConfigListener(engine);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue