diff options
author | David Crocker <dcrocker@eschertech.com> | 2021-06-02 17:06:23 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2021-06-02 17:06:23 +0300 |
commit | e8da1e9fadc21aac11cd2e2c36d1cedaca8a8606 (patch) | |
tree | 0e69fd35b34f97e6b5d62996ac14ec8d844ed3dc /src/Hardware/SAME70 | |
parent | 5a578f2a63d6e3b4526893f9beb6713f1224ef26 (diff) |
Corrected initialisation of Aux1 on Duet 3 MB6HC
Diffstat (limited to 'src/Hardware/SAME70')
-rw-r--r-- | src/Hardware/SAME70/Devices.cpp | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/src/Hardware/SAME70/Devices.cpp b/src/Hardware/SAME70/Devices.cpp index f6059509..008ac348 100644 --- a/src/Hardware/SAME70/Devices.cpp +++ b/src/Hardware/SAME70/Devices.cpp @@ -11,8 +11,32 @@ #include <AnalogOut.h> #include <matrix/matrix.h> -AsyncSerial Serial(UART2, UART2_IRQn, ID_UART2, 512, 512, [](AsyncSerial*) noexcept { }, [](AsyncSerial*) noexcept { }); -USARTClass Serial1(USART2, USART2_IRQn, ID_USART2, 512, 512, [](AsyncSerial*) noexcept { }, [](AsyncSerial*) noexcept { }); +AsyncSerial Serial(UART2, UART2_IRQn, ID_UART2, 512, 512, + [](AsyncSerial*) noexcept + { + SetPinFunction(APIN_Serial0_RXD, Serial0PinFunction); + SetPinFunction(APIN_Serial0_TXD, Serial0PinFunction); + }, + [](AsyncSerial*) noexcept + { + ClearPinFunction(APIN_Serial0_RXD); + ClearPinFunction(APIN_Serial0_TXD); + } + ); + +USARTClass Serial1(USART2, USART2_IRQn, ID_USART2, 512, 512, + [](AsyncSerial*) noexcept + { + SetPinFunction(APIN_Serial1_RXD, Serial1PinFunction); + SetPinFunction(APIN_Serial1_TXD, Serial1PinFunction); + }, + [](AsyncSerial*) noexcept + { + ClearPinFunction(APIN_Serial1_RXD); + ClearPinFunction(APIN_Serial1_TXD); + } + ); + SerialCDC SerialUSB; void UART2_Handler(void) noexcept @@ -25,17 +49,6 @@ void USART2_Handler(void) noexcept Serial1.IrqHandler(); } -void SerialInit() noexcept -{ - SetPinFunction(APIN_Serial0_RXD, Serial0PinFunction); - SetPinFunction(APIN_Serial0_TXD, Serial0PinFunction); - EnablePullup(APIN_Serial0_RXD); - - SetPinFunction(APIN_Serial1_RXD, Serial1PinFunction); - SetPinFunction(APIN_Serial1_TXD, Serial1PinFunction); - EnablePullup(APIN_Serial1_RXD); -} - void SdhcInit() noexcept { SetPinFunction(HsmciMclkPin, HsmciMclkPinFunction); @@ -62,7 +75,6 @@ void DeviceInit() noexcept LegacyAnalogIn::AnalogInInit(); AnalogOut::Init(); - SerialInit(); SdhcInit(); EthernetInit(); |