mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 04:41:35 +08:00
Replacing usleep with px4_usleep
This is a step towards isolating time from the system.
This commit is contained in:
@@ -340,7 +340,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
while (sim_delay) {
|
||||
usleep(100);
|
||||
px4_usleep(100);
|
||||
}
|
||||
|
||||
PX4_DEBUG("Called px4_poll timeout = %d", timeout);
|
||||
|
||||
@@ -234,7 +234,7 @@ int CDevExample::do_poll(int fd, int timeout, int iterations, int delayms_after_
|
||||
}
|
||||
|
||||
if (delayms_after_poll) {
|
||||
usleep(delayms_after_poll * 1000);
|
||||
px4_usleep(delayms_after_poll * 1000);
|
||||
}
|
||||
|
||||
loop_count++;
|
||||
|
||||
@@ -1280,7 +1280,7 @@ param_import_internal(int fd, bool mark_saved)
|
||||
|
||||
do {
|
||||
result = bson_decoder_next(&decoder);
|
||||
usleep(1);
|
||||
px4_usleep(1);
|
||||
|
||||
} while (result > 0);
|
||||
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@
|
||||
#include <nuttx/arch.h>
|
||||
#define dsm_udelay(arg) up_udelay(arg)
|
||||
#else
|
||||
#define dsm_udelay(arg) usleep(arg)
|
||||
#define dsm_udelay(arg) px4_usleep(arg)
|
||||
#endif
|
||||
|
||||
// #define DSM_DEBUG
|
||||
|
||||
Reference in New Issue
Block a user