HW CI has failed 11 times since Oct 2 #1849

This commit is contained in:
rusefillc 2020-10-03 20:25:37 -04:00
parent 731341dad1
commit bd78aa288d
2 changed files with 13 additions and 11 deletions

View File

@ -357,6 +357,15 @@ bool OutputPin::getAndSet(int logicValue) {
return oldValue;
}
void OutputPin::setOnchipValue(int electricalValue, int logicValue) {
if (port != GPIO_NULL) {
setPinValue(this, electricalValue, logicValue);
} else {
// even without physical pin sometimes it's nice to track logic pin value
currentLogicValue = logicValue;
}
}
void OutputPin::setValue(int logicValue) {
#if ENABLE_PERF_TRACE
// todo: https://github.com/rusefi/rusefi/issues/1638
@ -367,14 +376,11 @@ void OutputPin::setValue(int logicValue) {
efiAssertVoid(CUSTOM_ERR_6621, modePtr!=NULL, "pin mode not initialized");
pin_output_mode_e mode = *modePtr;
efiAssertVoid(CUSTOM_ERR_6622, mode <= OM_OPENDRAIN_INVERTED, "invalid pin_output_mode_e");
int eValue = getElectricalValue(logicValue, mode);
int electricalValue = getElectricalValue(logicValue, mode);
#if (BOARD_EXT_GPIOCHIPS > 0)
if (!this->ext) {
/* onchip pin */
if (port != GPIO_NULL) {
setPinValue(this, eValue, logicValue);
}
setOnchipValue(electricalValue, logicValue);
} else {
/* external pin */
gpiochips_writePad(this->brainPin, logicValue);
@ -382,12 +388,7 @@ void OutputPin::setValue(int logicValue) {
currentLogicValue = logicValue;
}
#else
if (port != GPIO_NULL) {
setPinValue(this, eValue, logicValue);
} else {
// even without physical pin sometimes it's nice to track logic pin value
currentLogicValue = logicValue;
}
setOnchipValue(electricalValue, logicValue);
#endif
#else /* EFI_PROD_CODE */

View File

@ -77,6 +77,7 @@ public:
private:
// todo: inline this method?
void setDefaultPinState(const pin_output_mode_e *defaultState);
void setOnchipValue(int electricalValue, int logicValue);
// 4 byte pointer is a bit of a memory waste here
const pin_output_mode_e *modePtr;