2012-08-22 21:40:19 -03:00
|
|
|
|
|
|
|
#include "HAL_AVR.h"
|
|
|
|
using namespace AP_HAL_AVR;
|
|
|
|
|
|
|
|
void HAL_AVR::init(void* opts) const {
|
2012-08-27 21:20:55 -03:00
|
|
|
|
2012-09-07 20:07:38 -03:00
|
|
|
scheduler->init((void*)&isr_registry);
|
2012-08-30 21:28:14 -03:00
|
|
|
|
2012-12-04 18:16:14 -04:00
|
|
|
/* uartA is the serial port used for the console, so lets make sure
|
2012-08-30 21:28:14 -03:00
|
|
|
* it is initialized at boot */
|
2012-12-04 18:16:14 -04:00
|
|
|
uartA->begin(115200);
|
|
|
|
console->init((void*)uartA);
|
2012-08-27 21:20:55 -03:00
|
|
|
/* The AVR RCInput drivers take an AP_HAL_AVR::ISRRegistry*
|
|
|
|
* as the init argument */
|
|
|
|
rcin->init((void*)&isr_registry);
|
|
|
|
rcout->init(NULL);
|
2012-08-30 20:25:35 -03:00
|
|
|
spi->init(NULL);
|
2012-10-11 14:48:45 -03:00
|
|
|
i2c->begin();
|
|
|
|
i2c->setTimeout(100);
|
2012-09-10 23:05:22 -03:00
|
|
|
analogin->init(NULL);
|
2012-08-22 21:40:19 -03:00
|
|
|
};
|
|
|
|
|