mirror of https://github.com/ArduPilot/ardupilot
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:
parent
19b4ca60c4
commit
b29d6eff5d
|
@ -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__
|
||||
|
|
Loading…
Reference in New Issue