parent
44facf1140
commit
cb668e5234
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue