mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-01 21:48:28 -04:00
AP_HAL_AVR: merge init() and run()
This commit is contained in:
parent
1649104382
commit
e18884a328
@ -58,7 +58,9 @@ HAL_AVR_APM1::HAL_AVR_APM1() :
|
||||
&avrUtil )
|
||||
{}
|
||||
|
||||
void HAL_AVR_APM1::init(int argc, char * const argv[]) const {
|
||||
void HAL_AVR_APM1::run(int argc, char* const argv[], Callbacks* callbacks) const
|
||||
{
|
||||
assert(callbacks);
|
||||
|
||||
scheduler->init((void*)&isrRegistry);
|
||||
|
||||
@ -86,13 +88,6 @@ void HAL_AVR_APM1::init(int argc, char * const argv[]) const {
|
||||
PORTE |= _BV(0);
|
||||
PORTD |= _BV(2);
|
||||
PORTJ |= _BV(0);
|
||||
};
|
||||
|
||||
void HAL_AVR_APM1::run(int argc, char* const argv[], Callbacks* callbacks) const
|
||||
{
|
||||
assert(callbacks);
|
||||
|
||||
init(argc, argv);
|
||||
|
||||
callbacks->setup();
|
||||
scheduler->system_initialized();
|
||||
|
@ -20,7 +20,6 @@
|
||||
class HAL_AVR_APM1 : public AP_HAL::HAL {
|
||||
public:
|
||||
HAL_AVR_APM1();
|
||||
void init(int argc, char * const argv[]) const;
|
||||
void run(int argc, char* const argv[], Callbacks* callbacks) const override;
|
||||
};
|
||||
|
||||
|
@ -57,7 +57,9 @@ HAL_AVR_APM2::HAL_AVR_APM2() :
|
||||
&avrUtil )
|
||||
{}
|
||||
|
||||
void HAL_AVR_APM2::init(int argc, char * const argv[]) const {
|
||||
void HAL_AVR_APM2::run(int argc, char* const argv[], Callbacks* callbacks) const
|
||||
{
|
||||
assert(callbacks);
|
||||
|
||||
scheduler->init((void*)&isrRegistry);
|
||||
|
||||
@ -85,13 +87,6 @@ void HAL_AVR_APM2::init(int argc, char * const argv[]) const {
|
||||
PORTE |= _BV(0);
|
||||
PORTD |= _BV(2);
|
||||
PORTH |= _BV(0);
|
||||
};
|
||||
|
||||
void HAL_AVR_APM2::run(int argc, char* const argv[], Callbacks* callbacks) const
|
||||
{
|
||||
assert(callbacks);
|
||||
|
||||
init(argc, argv);
|
||||
|
||||
callbacks->setup();
|
||||
scheduler->system_initialized();
|
||||
|
@ -20,7 +20,6 @@
|
||||
class HAL_AVR_APM2 : public AP_HAL::HAL {
|
||||
public:
|
||||
HAL_AVR_APM2();
|
||||
void init(int argc, char * const argv[]) const;
|
||||
void run(int argc, char* const argv[], Callbacks* callbacks) const override;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user