fix master (#1375)

* fix

* put back how it was

* missed a spot
This commit is contained in:
Matthew Kennedy 2020-04-28 05:08:41 -07:00 committed by GitHub
parent 44facf1140
commit cb668e5234
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 4 deletions

View File

@ -145,14 +145,21 @@ void enableFrankensoCan(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
engineConfiguration->canReadEnabled = false;
}
static brain_pin_e currentTxPin = GPIO_UNASSIGNED;
static brain_pin_e currentRxPin = GPIO_UNASSIGNED;
void stopCanPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
brain_pin_markUnused(activeConfiguration.canTxPin);
brain_pin_markUnused(activeConfiguration.canRxPin);
brain_pin_markUnused(currentTxPin);
brain_pin_markUnused(currentRxPin);
}
void startCanPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
efiSetPadMode("CAN TX", CONFIG_OVERRIDE(canTxPin), PAL_MODE_ALTERNATE(EFI_CAN_TX_AF));
efiSetPadMode("CAN RX", CONFIG_OVERRIDE(canRxPin), PAL_MODE_ALTERNATE(EFI_CAN_RX_AF));
// Store pins so we can disable later
currentTxPin = CONFIG_OVERRIDE(canTxPin);
currentRxPin = CONFIG_OVERRIDE(canRxPin);
efiSetPadMode("CAN TX", currentTxPin, PAL_MODE_ALTERNATE(EFI_CAN_TX_AF));
efiSetPadMode("CAN RX", currentRxPin, PAL_MODE_ALTERNATE(EFI_CAN_RX_AF));
}
void initCan(void) {