auto-sync
This commit is contained in:
parent
35deb70c70
commit
8fa81e4676
|
@ -427,10 +427,10 @@ void setDefaultConfiguration(engine_configuration_s *engineConfiguration, board_
|
|||
boardConfiguration->ignitionPins[11] = GPIO_UNASSIGNED;
|
||||
boardConfiguration->ignitionPinMode = OM_DEFAULT;
|
||||
|
||||
boardConfiguration->malfunctionIndicatorPin = GPIOC_9;
|
||||
boardConfiguration->malfunctionIndicatorPin = GPIO_UNASSIGNED;
|
||||
boardConfiguration->malfunctionIndicatorPinMode = OM_DEFAULT;
|
||||
|
||||
boardConfiguration->fanPin = GPIOC_15;
|
||||
boardConfiguration->fanPin = GPIO_UNASSIGNED;
|
||||
boardConfiguration->fanPinMode = OM_DEFAULT;
|
||||
|
||||
boardConfiguration->clutchDownPin = GPIO_UNASSIGNED;
|
||||
|
|
|
@ -694,6 +694,16 @@ static void setLogicInputPin(const char *indexStr, const char *pinName) {
|
|||
scheduleMsg(&logger, "setting logic input pin[%d] to %s please save&restart", index, hwPortname(pin));
|
||||
boardConfiguration->logicAnalyzerPins[index] = pin;
|
||||
}
|
||||
|
||||
static void showPinFunction(const char *pinName) {
|
||||
brain_pin_e pin = parseBrainPin(pinName);
|
||||
if (pin == GPIO_INVALID) {
|
||||
scheduleMsg(&logger, "invalid pin name [%s]", pinName);
|
||||
return;
|
||||
}
|
||||
scheduleMsg(&logger, "Pin %s: [%s]", pinName, getPinFunction(pin));
|
||||
}
|
||||
|
||||
#endif /* EFI_PROD_CODE */
|
||||
|
||||
static void setTimingMap(const char * rpmStr, const char *loadStr, const char *valueStr) {
|
||||
|
@ -921,6 +931,7 @@ void initSettings(engine_configuration_s *engineConfiguration) {
|
|||
addConsoleActionFF("set_fan", setFanSetting);
|
||||
|
||||
#if EFI_PROD_CODE
|
||||
addConsoleActionS("showpin", showPinFunction);
|
||||
addConsoleActionSS("set_injection_pin", setInjectionPin);
|
||||
addConsoleActionSS("set_ignition_pin", setIgnitionPin);
|
||||
addConsoleActionSS("set_trigger_input_pin", setTriggerInputPin);
|
||||
|
|
|
@ -156,6 +156,19 @@ iomode_t getInputMode(pin_input_mode_e mode) {
|
|||
}
|
||||
}
|
||||
|
||||
static int getIndex(ioportid_t port, ioportmask_t pin) {
|
||||
int portIndex = getPortIndex(port);
|
||||
return portIndex * 16 + pin;
|
||||
}
|
||||
|
||||
const char * getPinFunction(brain_input_pin_e brainPin) {
|
||||
ioportid_t port = getHwPort(brainPin);
|
||||
ioportmask_t pin = getHwPin(brainPin);
|
||||
|
||||
int index = getIndex(port, pin);
|
||||
return PIN_USED[index];
|
||||
}
|
||||
|
||||
/**
|
||||
* This method would set an error condition if pin is already used
|
||||
*/
|
||||
|
@ -172,8 +185,7 @@ void mySetPadMode(const char *msg, ioportid_t port, ioportmask_t pin, iomode_t m
|
|||
appendPrintf(&logger, " on %s%d%s", portname(port), pin, DELIMETER);
|
||||
printLine(&logger);
|
||||
|
||||
int portIndex = getPortIndex(port);
|
||||
int index = portIndex * 16 + pin;
|
||||
int index = getIndex(port, pin);
|
||||
|
||||
if (PIN_USED[index] != NULL) {
|
||||
/**
|
||||
|
@ -193,8 +205,7 @@ void unmarkPin(brain_pin_e brainPin) {
|
|||
ioportid_t port = getHwPort(brainPin);
|
||||
ioportmask_t pin = getHwPin(brainPin);
|
||||
|
||||
int portIndex = getPortIndex(port);
|
||||
int index = portIndex * 16 + pin;
|
||||
int index = getIndex(port, pin);
|
||||
|
||||
if (PIN_USED[index] != NULL) {
|
||||
PIN_USED[index] = NULL;
|
||||
|
@ -208,8 +219,7 @@ void unmarkPin(brain_pin_e brainPin) {
|
|||
void registedFundamentralIoPin(char *msg, ioportid_t port, ioportmask_t pin, iomode_t mode) {
|
||||
efiAssertVoid(initialized, "repo not initialized");
|
||||
|
||||
int portIndex = getPortIndex(port);
|
||||
int index = portIndex * 16 + pin;
|
||||
int index = getIndex(port, pin);
|
||||
|
||||
if (PIN_USED[index] != NULL) {
|
||||
print("!!!!!!!!!!!!! Already used [%s] %d\r\n", msg, pin);
|
||||
|
|
|
@ -30,6 +30,7 @@ void initPinRepository(void);
|
|||
const char *hwPortname(brain_pin_e brainPin);
|
||||
brain_pin_e parseBrainPin(const char *str);
|
||||
void mySetPadMode(const char *msg, ioportid_t port, ioportmask_t pin, iomode_t mode);
|
||||
const char * getPinFunction(brain_input_pin_e brainPin);
|
||||
void mySetPadMode2(const char *msg, brain_pin_e pin, iomode_t mode);
|
||||
const char *portname(GPIO_TypeDef* GPIOx);
|
||||
iomode_t getInputMode(pin_input_mode_e mode);
|
||||
|
|
Loading…
Reference in New Issue