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:
Mark Charlebois
2015-04-20 11:13:24 -07:00
parent 598b05fcba
commit 2feeecdab1
9 changed files with 321 additions and 503 deletions
@@ -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;
}
+1
View File
@@ -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__)