diff --git a/libraries/AP_HAL/AP_HAL_Main.h b/libraries/AP_HAL/AP_HAL_Main.h index a729b3a3a7..acc7815424 100644 --- a/libraries/AP_HAL/AP_HAL_Main.h +++ b/libraries/AP_HAL/AP_HAL_Main.h @@ -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__