AP_HAL: add an AP_HAL_MAIN_CALLBACKS() macro

This is going to be used by vehicles that already have an object with
setup/loop functions. The vehicle object will just implement the
HAL::Callbacks interface.
This commit is contained in:
Caio Marcelo de Oliveira Filho 2015-10-19 16:05:54 -02:00 committed by Andrew Tridgell
parent 19b4ca60c4
commit b29d6eff5d
1 changed files with 14 additions and 0 deletions

View File

@ -25,6 +25,13 @@
} \
}
#define AP_HAL_MAIN_CALLBACKS(CALLBACKS) extern "C" { \
int AP_MAIN(void) { \
hal.run(0, NULL, CALLBACKS); \
return 0; \
} \
}
#else
#define AP_HAL_MAIN() extern "C" { \
@ -35,6 +42,13 @@
} \
}
#define AP_HAL_MAIN_CALLBACKS(CALLBACKS) extern "C" { \
int AP_MAIN(int argc, char* const argv[]) { \
hal.run(argc, argv, CALLBACKS); \
return 0; \
} \
}
#endif
#endif // __AP_HAL_MAIN_H__