mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 21:23:33 +08:00
Linux: Added config and stubs to compile I2C device for Linux
Not yet functional. Full implementation will provide an IOCTL interface to do bi-directional transfer. will model the interface after Linux. Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -53,14 +53,14 @@ int HRTTest::main()
|
||||
hrt_abstime t = hrt_absolute_time();
|
||||
usleep(1000000);
|
||||
hrt_abstime elt = hrt_elapsed_time(&t);
|
||||
printf("Elapsed time %llu in 1 sec (usleep)\n", elt);
|
||||
printf("Start time %llu\n", t);
|
||||
printf("Elapsed time %lu in 1 sec (usleep)\n", elt);
|
||||
printf("Start time %lu\n", t);
|
||||
|
||||
t = hrt_absolute_time();
|
||||
sleep(1);
|
||||
elt = hrt_elapsed_time(&t);
|
||||
printf("Elapsed time %llu in 1 sec (sleep)\n", elt);
|
||||
printf("Start time %llu\n", t);
|
||||
printf("Elapsed time %lu in 1 sec (sleep)\n", elt);
|
||||
printf("Start time %lu\n", t);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#include <px4_config.h>
|
||||
#elif defined (__PX4_LINUX)
|
||||
#define CONFIG_NFILE_STREAMS 1
|
||||
#define PX4_I2C_BUS_ONBOARD 1
|
||||
|
||||
#define px4_errx(x, ...) errx(x, __VA_ARGS__)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user