AP_HAL_Empty: implement HAL::run()
This commit is contained in:
parent
72cd5ef185
commit
346ab77c27
@ -6,11 +6,9 @@
|
||||
#if CONFIG_HAL_BOARD == HAL_BOARD_EMPTY
|
||||
#define AP_HAL_MAIN() extern "C" {\
|
||||
int main (void) {\
|
||||
hal.init(0, NULL); \
|
||||
setup();\
|
||||
hal.scheduler->system_initialized(); \
|
||||
for(;;) loop();\
|
||||
return 0;\
|
||||
AP_HAL::HAL::FunCallbacks callbacks(setup, loop); \
|
||||
hal.run(0, NULL, &callbacks); \
|
||||
return 0; \
|
||||
}\
|
||||
}
|
||||
#endif // HAL_BOARD_EMPTY
|
||||
|
@ -2,6 +2,8 @@
|
||||
#include <AP_HAL/AP_HAL.h>
|
||||
#if CONFIG_HAL_BOARD == HAL_BOARD_EMPTY
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "HAL_Empty_Class.h"
|
||||
#include "AP_HAL_Empty_Private.h"
|
||||
|
||||
@ -52,6 +54,20 @@ void HAL_Empty::init(int argc,char* const argv[]) const {
|
||||
_member->init();
|
||||
}
|
||||
|
||||
void HAL_Empty::run(int argc, char* const argv[], Callbacks* callbacks) const
|
||||
{
|
||||
assert(callbacks);
|
||||
|
||||
init(argc, argv);
|
||||
|
||||
callbacks->setup();
|
||||
scheduler->system_initialized();
|
||||
|
||||
for (;;) {
|
||||
callbacks->loop();
|
||||
}
|
||||
}
|
||||
|
||||
const AP_HAL::HAL& AP_HAL::get_HAL() {
|
||||
static const HAL_Empty hal;
|
||||
return hal;
|
||||
|
@ -11,6 +11,7 @@ class HAL_Empty : public AP_HAL::HAL {
|
||||
public:
|
||||
HAL_Empty();
|
||||
void init(int argc, char * const * argv) const;
|
||||
void run(int argc, char* const* argv, Callbacks* callbacks) const override;
|
||||
private:
|
||||
Empty::EmptyPrivateMember *_member;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user