From 1cd09be2fd3315fba88dcef82b0e5d594444b431 Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Thu, 18 Oct 2012 21:54:46 -0700 Subject: [PATCH] AP_HAL_AVR: proper empty uart for APM1 vs APM2 * APM1 uses uart2 as a spi port (dataflash) * APM2 uses uart3 as a spi port (dataflash) --- libraries/AP_HAL_AVR/AP_HAL_AVR.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libraries/AP_HAL_AVR/AP_HAL_AVR.cpp b/libraries/AP_HAL_AVR/AP_HAL_AVR.cpp index 479bb07d44..176d8fb0d8 100644 --- a/libraries/AP_HAL_AVR/AP_HAL_AVR.cpp +++ b/libraries/AP_HAL_AVR/AP_HAL_AVR.cpp @@ -21,12 +21,14 @@ using namespace AP_HAL_AVR; AVRUARTDriverISRs(0); AVRUARTDriverISRs(1); +AVRUARTDriverISRs(2); AVRUARTDriverISRs(3); static AVRUARTDriverInstance(avrUart0Driver, 0); static AVRUARTDriverInstance(avrUart1Driver, 1); -static EmptyUARTDriver avrUart2Driver; +static AVRUARTDriverInstance(avrUart2Driver, 2); static AVRUARTDriverInstance(avrUart3Driver, 3); +static EmptyUARTDriver emptyUartDriver; static AVRI2CDriver avrI2CDriver; static ArduinoSPIDriver arduinoSPIDriver; @@ -46,7 +48,7 @@ static ArduinoScheduler arduinoScheduler; const HAL_AVR AP_HAL_AVR_APM1( (UARTDriver*) &avrUart0Driver, (UARTDriver*) &avrUart1Driver, - (UARTDriver*) &avrUart2Driver, + (UARTDriver*) &emptyUartDriver, (UARTDriver*) &avrUart3Driver, &avrI2CDriver, &arduinoSPIDriver, @@ -63,7 +65,7 @@ const HAL_AVR AP_HAL_AVR_APM2( (UARTDriver*) &avrUart0Driver, (UARTDriver*) &avrUart1Driver, (UARTDriver*) &avrUart2Driver, - (UARTDriver*) &avrUart3Driver, + (UARTDriver*) &emptyUartDriver, &avrI2CDriver, &arduinoSPIDriver, &apm2AnalogIn,