Replacing usleep with px4_usleep

This is a step towards isolating time from the system.
This commit is contained in:
Julian Oes
2018-12-22 10:32:18 +01:00
parent e485885344
commit 5b9dea5604
112 changed files with 339 additions and 305 deletions
+4 -4
View File
@@ -313,7 +313,7 @@ MS5611::init()
break;
}
usleep(MS5611_CONVERSION_INTERVAL);
px4_usleep(MS5611_CONVERSION_INTERVAL);
if (OK != collect()) {
ret = -EIO;
@@ -326,7 +326,7 @@ MS5611::init()
break;
}
usleep(MS5611_CONVERSION_INTERVAL);
px4_usleep(MS5611_CONVERSION_INTERVAL);
if (OK != collect()) {
ret = -EIO;
@@ -429,7 +429,7 @@ MS5611::read(struct file *filp, char *buffer, size_t buflen)
break;
}
usleep(MS5611_CONVERSION_INTERVAL);
px4_usleep(MS5611_CONVERSION_INTERVAL);
if (OK != collect()) {
ret = -EIO;
@@ -442,7 +442,7 @@ MS5611::read(struct file *filp, char *buffer, size_t buflen)
break;
}
usleep(MS5611_CONVERSION_INTERVAL);
px4_usleep(MS5611_CONVERSION_INTERVAL);
if (OK != collect()) {
ret = -EIO;
+2 -1
View File
@@ -40,6 +40,7 @@
/* XXX trim includes */
#include <px4_config.h>
#include <px4_defines.h>
#include <px4_time.h>
#include <sys/types.h>
#include <stdint.h>
@@ -238,7 +239,7 @@ MS5611_I2C::_read_prom()
* Wait for PROM contents to be in the device (2.8 ms) in the case we are
* called immediately after reset.
*/
usleep(3000);
px4_usleep(3000);
uint8_t last_val = 0;
bool bits_stuck = true;
+2 -1
View File
@@ -38,6 +38,7 @@
*/
/* XXX trim includes */
#include <px4_time.h>
#include <px4_config.h>
#include <sys/types.h>
@@ -248,7 +249,7 @@ MS5611_SPI::_read_prom()
* Wait for PROM contents to be in the device (2.8 ms) in the case we are
* called immediately after reset.
*/
usleep(3000);
px4_usleep(3000);
/* read and convert PROM words */
bool all_zero = true;