--- /dev/null
+/******************************************************************************
+ BNO055 Library
+ Delay
+ Copyright (C) 2019 Walter Fetter Lages <w.fetter@ieee.org>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see
+ <http://www.gnu.org/licenses/>.
+
+*******************************************************************************/
+
+#ifndef __BNO055_DELAY_H__
+#define __BNO055_DELAY_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include <bno055.h>
+
+/* Brief : Delay routine
+ * \param : delay in ms
+*/
+extern void BNO055_delay(u32 ms);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
TARGET=libbno055ifc.a
-SRCS=bno055_tty.c
+SRCS=bno055_tty.c bno055_delay.c
FLAGS=-O2 -Wall -MMD
INCLUDE=-I. -I../include -I../../BNO055_driver
--- /dev/null
+/******************************************************************************
+ BNO055 Library
+ Delay
+ Copyright (C) 2019 Walter Fetter Lages <w.fetter@ieee.org>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see
+ <http://www.gnu.org/licenses/>.
+
+*******************************************************************************/
+
+#include <unistd.h>
+
+#include <bno055_delay.h>
+
+void BNO055_delay(u32 ms)
+{
+ usleep(ms*1000);
+}
#include <unistd.h>
#include <sys/ioctl.h>
+#include <bno055_delay.h>
#include <bno055_tty.h>
s8 BNO055_tty_init(int fd,struct bno055_t *bno055)
bno055->bus_write=BNO055_tty_write;
bno055->bus_read=BNO055_tty_read;
- bno055->delay_msec=BNO055_tty_delay_ms;
+ bno055->delay_msec=BNO055_delay;
bno055->dev_addr=fd;
return BNO055_SUCCESS;
}
return BNO055_SUCCESS;
}
-
-void BNO055_tty_delay_ms(u32 ms)
-{
- usleep(ms*1000);
-}