mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
and remove the px4_ prefix, except for px4_config.h.
command to update includes:
for k in app.h atomic.h cli.h console_buffer.h defines.h getopt.h i2c.h init.h log.h micro_hal.h module.h module_params.h param.h param_macros.h posix.h sem.h sem.hpp shmem.h shutdown.h tasks.h time.h workqueue.h; do for i in $(grep -rl 'include <px4_'$k src platforms boards); do sed -i 's/#include <px4_'$k'/#include <px4_platform_common\/'$k/ $i; done; done
for in $(grep -rl 'include <px4_config.h' src platforms boards); do sed -i 's/#include <px4_config.h/#include <px4_platform_common\/px4_config.h'/ $i; done
Transitional headers for submodules are added (px4_{defines,log,time}.h)
17 lines
340 B
C++
17 lines
340 B
C++
#include <px4_platform_common/log.h>
|
|
#include <px4_platform_common/app.h>
|
|
|
|
extern "C" __EXPORT int hello_main(int argc, char *argv[]);
|
|
int hello_main(int argc, char *argv[])
|
|
{
|
|
PX4_INFO("Hello, I am a dynamically loaded module.");
|
|
|
|
PX4_INFO("Argv:");
|
|
|
|
for (int i = 0; i < argc; ++i) {
|
|
PX4_INFO(" %d: %s", i, argv[i]);
|
|
}
|
|
|
|
return 0;
|
|
}
|