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