AP_HAL_AVR: change uart0,1,2,3 to uartA,B,C

This commit is contained in:
Pat Hickey 2012-12-04 14:16:14 -08:00 committed by Andrew Tridgell
parent dbb6a2a0e5
commit 50b765616b
3 changed files with 12 additions and 14 deletions

View File

@ -28,7 +28,6 @@ static AVRUARTDriverInstance(avrUart0Driver, 0);
static AVRUARTDriverInstance(avrUart1Driver, 1);
static AVRUARTDriverInstance(avrUart2Driver, 2);
static AVRUARTDriverInstance(avrUart3Driver, 3);
static EmptyUARTDriver emptyUartDriver;
static AVRI2CDriver avrI2CDriver;
static APM1SPIDeviceManager apm1SPIDriver;
@ -45,11 +44,11 @@ static APM1RCOutput apm1RCOutput;
static APM2RCOutput apm2RCOutput;
static AVRScheduler avrScheduler;
/* On APM1 the physical UART2 is used for SPI. */
const HAL_AVR AP_HAL_AVR_APM1(
(UARTDriver*) &avrUart0Driver,
(UARTDriver*) &avrUart1Driver,
(UARTDriver*) &emptyUartDriver,
(UARTDriver*) &avrUart3Driver,
(UARTDriver*) &avrUart0Driver, /* phys UART0 -> uartA */
(UARTDriver*) &avrUart1Driver, /* phys UART1 -> uartB */
(UARTDriver*) &avrUart3Driver, /* phys UART3 -> uartC */
&avrI2CDriver,
&apm1SPIDriver,
&avrAnalogIn,
@ -61,11 +60,11 @@ const HAL_AVR AP_HAL_AVR_APM1(
&apm1RCOutput,
&avrScheduler );
/* On APM1 the physical UART3 is used for SPI. */
const HAL_AVR AP_HAL_AVR_APM2(
(UARTDriver*) &avrUart0Driver,
(UARTDriver*) &avrUart1Driver,
(UARTDriver*) &avrUart2Driver,
(UARTDriver*) &emptyUartDriver,
&avrI2CDriver,
&apm2SPIDriver,
&avrAnalogIn,

View File

@ -6,10 +6,10 @@ void HAL_AVR::init(void* opts) const {
scheduler->init((void*)&isr_registry);
/* uart0 is the serial port used for the console, so lets make sure
/* uartA is the serial port used for the console, so lets make sure
* it is initialized at boot */
uart0->begin(115200);
console->init((void*)uart0);
uartA->begin(115200);
console->init((void*)uartA);
/* The AVR RCInput drivers take an AP_HAL_AVR::ISRRegistry*
* as the init argument */
rcin->init((void*)&isr_registry);

View File

@ -14,10 +14,9 @@
class AP_HAL_AVR::HAL_AVR : public AP_HAL::HAL {
public:
HAL_AVR(
AP_HAL::UARTDriver* _uart0,
AP_HAL::UARTDriver* _uart1,
AP_HAL::UARTDriver* _uart2,
AP_HAL::UARTDriver* _uart3,
AP_HAL::UARTDriver* _uartA,
AP_HAL::UARTDriver* _uartB,
AP_HAL::UARTDriver* _uartC,
AP_HAL::I2CDriver* _i2c,
AP_HAL::SPIDeviceManager* _spi,
AP_HAL::AnalogIn* _analogin,
@ -28,7 +27,7 @@ public:
AP_HAL::RCInput* _rcin,
AP_HAL::RCOutput* _rcout,
AP_HAL::Scheduler* _scheduler)
: AP_HAL::HAL( _uart0, _uart1, _uart2, _uart3,
: AP_HAL::HAL( _uartA, _uartB, _uartC,
_i2c, _spi, _analogin, _storage,
_dataflash, _console, _gpio, _rcin,
_rcout, _scheduler) {}