AP_HAL_AVR: change uart0,1,2,3 to uartA,B,C
This commit is contained in:
parent
dbb6a2a0e5
commit
50b765616b
@ -28,7 +28,6 @@ static AVRUARTDriverInstance(avrUart0Driver, 0);
|
|||||||
static AVRUARTDriverInstance(avrUart1Driver, 1);
|
static AVRUARTDriverInstance(avrUart1Driver, 1);
|
||||||
static AVRUARTDriverInstance(avrUart2Driver, 2);
|
static AVRUARTDriverInstance(avrUart2Driver, 2);
|
||||||
static AVRUARTDriverInstance(avrUart3Driver, 3);
|
static AVRUARTDriverInstance(avrUart3Driver, 3);
|
||||||
static EmptyUARTDriver emptyUartDriver;
|
|
||||||
|
|
||||||
static AVRI2CDriver avrI2CDriver;
|
static AVRI2CDriver avrI2CDriver;
|
||||||
static APM1SPIDeviceManager apm1SPIDriver;
|
static APM1SPIDeviceManager apm1SPIDriver;
|
||||||
@ -45,11 +44,11 @@ static APM1RCOutput apm1RCOutput;
|
|||||||
static APM2RCOutput apm2RCOutput;
|
static APM2RCOutput apm2RCOutput;
|
||||||
static AVRScheduler avrScheduler;
|
static AVRScheduler avrScheduler;
|
||||||
|
|
||||||
|
/* On APM1 the physical UART2 is used for SPI. */
|
||||||
const HAL_AVR AP_HAL_AVR_APM1(
|
const HAL_AVR AP_HAL_AVR_APM1(
|
||||||
(UARTDriver*) &avrUart0Driver,
|
(UARTDriver*) &avrUart0Driver, /* phys UART0 -> uartA */
|
||||||
(UARTDriver*) &avrUart1Driver,
|
(UARTDriver*) &avrUart1Driver, /* phys UART1 -> uartB */
|
||||||
(UARTDriver*) &emptyUartDriver,
|
(UARTDriver*) &avrUart3Driver, /* phys UART3 -> uartC */
|
||||||
(UARTDriver*) &avrUart3Driver,
|
|
||||||
&avrI2CDriver,
|
&avrI2CDriver,
|
||||||
&apm1SPIDriver,
|
&apm1SPIDriver,
|
||||||
&avrAnalogIn,
|
&avrAnalogIn,
|
||||||
@ -61,11 +60,11 @@ const HAL_AVR AP_HAL_AVR_APM1(
|
|||||||
&apm1RCOutput,
|
&apm1RCOutput,
|
||||||
&avrScheduler );
|
&avrScheduler );
|
||||||
|
|
||||||
|
/* On APM1 the physical UART3 is used for SPI. */
|
||||||
const HAL_AVR AP_HAL_AVR_APM2(
|
const HAL_AVR AP_HAL_AVR_APM2(
|
||||||
(UARTDriver*) &avrUart0Driver,
|
(UARTDriver*) &avrUart0Driver,
|
||||||
(UARTDriver*) &avrUart1Driver,
|
(UARTDriver*) &avrUart1Driver,
|
||||||
(UARTDriver*) &avrUart2Driver,
|
(UARTDriver*) &avrUart2Driver,
|
||||||
(UARTDriver*) &emptyUartDriver,
|
|
||||||
&avrI2CDriver,
|
&avrI2CDriver,
|
||||||
&apm2SPIDriver,
|
&apm2SPIDriver,
|
||||||
&avrAnalogIn,
|
&avrAnalogIn,
|
||||||
|
@ -6,10 +6,10 @@ void HAL_AVR::init(void* opts) const {
|
|||||||
|
|
||||||
scheduler->init((void*)&isr_registry);
|
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 */
|
* it is initialized at boot */
|
||||||
uart0->begin(115200);
|
uartA->begin(115200);
|
||||||
console->init((void*)uart0);
|
console->init((void*)uartA);
|
||||||
/* The AVR RCInput drivers take an AP_HAL_AVR::ISRRegistry*
|
/* The AVR RCInput drivers take an AP_HAL_AVR::ISRRegistry*
|
||||||
* as the init argument */
|
* as the init argument */
|
||||||
rcin->init((void*)&isr_registry);
|
rcin->init((void*)&isr_registry);
|
||||||
|
@ -14,10 +14,9 @@
|
|||||||
class AP_HAL_AVR::HAL_AVR : public AP_HAL::HAL {
|
class AP_HAL_AVR::HAL_AVR : public AP_HAL::HAL {
|
||||||
public:
|
public:
|
||||||
HAL_AVR(
|
HAL_AVR(
|
||||||
AP_HAL::UARTDriver* _uart0,
|
AP_HAL::UARTDriver* _uartA,
|
||||||
AP_HAL::UARTDriver* _uart1,
|
AP_HAL::UARTDriver* _uartB,
|
||||||
AP_HAL::UARTDriver* _uart2,
|
AP_HAL::UARTDriver* _uartC,
|
||||||
AP_HAL::UARTDriver* _uart3,
|
|
||||||
AP_HAL::I2CDriver* _i2c,
|
AP_HAL::I2CDriver* _i2c,
|
||||||
AP_HAL::SPIDeviceManager* _spi,
|
AP_HAL::SPIDeviceManager* _spi,
|
||||||
AP_HAL::AnalogIn* _analogin,
|
AP_HAL::AnalogIn* _analogin,
|
||||||
@ -28,7 +27,7 @@ public:
|
|||||||
AP_HAL::RCInput* _rcin,
|
AP_HAL::RCInput* _rcin,
|
||||||
AP_HAL::RCOutput* _rcout,
|
AP_HAL::RCOutput* _rcout,
|
||||||
AP_HAL::Scheduler* _scheduler)
|
AP_HAL::Scheduler* _scheduler)
|
||||||
: AP_HAL::HAL( _uart0, _uart1, _uart2, _uart3,
|
: AP_HAL::HAL( _uartA, _uartB, _uartC,
|
||||||
_i2c, _spi, _analogin, _storage,
|
_i2c, _spi, _analogin, _storage,
|
||||||
_dataflash, _console, _gpio, _rcin,
|
_dataflash, _console, _gpio, _rcin,
|
||||||
_rcout, _scheduler) {}
|
_rcout, _scheduler) {}
|
||||||
|
Loading…
Reference in New Issue
Block a user