mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-08 17:03:57 -04:00
AP_HAL_Linux: fixed AP_MODULE_SUPPORTED on static build
This commit is contained in:
parent
ea1a6b2044
commit
15b8ae99fe
@ -274,14 +274,18 @@ void _usage(void)
|
|||||||
printf("\tcustom terrain path:\n");
|
printf("\tcustom terrain path:\n");
|
||||||
printf("\t --terrain-directory /var/APM/terrain\n");
|
printf("\t --terrain-directory /var/APM/terrain\n");
|
||||||
printf("\t -t /var/APM/terrain\n");
|
printf("\t -t /var/APM/terrain\n");
|
||||||
|
#if AP_MODULE_SUPPORTED
|
||||||
printf("\tmodule support:\n");
|
printf("\tmodule support:\n");
|
||||||
printf("\t --module-directory %s\n", AP_MODULE_DEFAULT_DIRECTORY);
|
printf("\t --module-directory %s\n", AP_MODULE_DEFAULT_DIRECTORY);
|
||||||
printf("\t -M %s\n", AP_MODULE_DEFAULT_DIRECTORY);
|
printf("\t -M %s\n", AP_MODULE_DEFAULT_DIRECTORY);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void HAL_Linux::run(int argc, char* const argv[], Callbacks* callbacks) const
|
void HAL_Linux::run(int argc, char* const argv[], Callbacks* callbacks) const
|
||||||
{
|
{
|
||||||
|
#if AP_MODULE_SUPPORTED
|
||||||
const char *module_path = AP_MODULE_DEFAULT_DIRECTORY;
|
const char *module_path = AP_MODULE_DEFAULT_DIRECTORY;
|
||||||
|
#endif
|
||||||
|
|
||||||
assert(callbacks);
|
assert(callbacks);
|
||||||
|
|
||||||
@ -344,9 +348,11 @@ void HAL_Linux::run(int argc, char* const argv[], Callbacks* callbacks) const
|
|||||||
case 't':
|
case 't':
|
||||||
utilInstance.set_custom_terrain_directory(gopt.optarg);
|
utilInstance.set_custom_terrain_directory(gopt.optarg);
|
||||||
break;
|
break;
|
||||||
|
#if AP_MODULE_SUPPORTED
|
||||||
case 'M':
|
case 'M':
|
||||||
module_path = gopt.optarg;
|
module_path = gopt.optarg;
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
case 'h':
|
case 'h':
|
||||||
_usage();
|
_usage();
|
||||||
exit(0);
|
exit(0);
|
||||||
@ -374,13 +380,19 @@ void HAL_Linux::run(int argc, char* const argv[], Callbacks* callbacks) const
|
|||||||
scheduler->system_initialized();
|
scheduler->system_initialized();
|
||||||
|
|
||||||
// possibly load external modules
|
// possibly load external modules
|
||||||
|
#if AP_MODULE_SUPPORTED
|
||||||
if (module_path != nullptr) {
|
if (module_path != nullptr) {
|
||||||
AP_Module::init(module_path);
|
AP_Module::init(module_path);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if AP_MODULE_SUPPORTED
|
||||||
AP_Module::call_hook_setup_start();
|
AP_Module::call_hook_setup_start();
|
||||||
|
#endif
|
||||||
callbacks->setup();
|
callbacks->setup();
|
||||||
|
#if AP_MODULE_SUPPORTED
|
||||||
AP_Module::call_hook_setup_complete();
|
AP_Module::call_hook_setup_complete();
|
||||||
|
#endif
|
||||||
|
|
||||||
while (!_should_exit) {
|
while (!_should_exit) {
|
||||||
callbacks->loop();
|
callbacks->loop();
|
||||||
|
Loading…
Reference in New Issue
Block a user