mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-02 13:51:36 +08:00
microRTPS: replace usleep() by px4_usleep()
This commit is contained in:
@@ -123,7 +123,7 @@ void* send(void* /*unused*/)
|
|||||||
}
|
}
|
||||||
@[end for]@
|
@[end for]@
|
||||||
|
|
||||||
usleep(_options.sleep_ms*1000);
|
px4_usleep(_options.sleep_ms*1000);
|
||||||
++loop;
|
++loop;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,7 +212,7 @@ void micrortps_start_topics(struct timespec &begin, int &total_read, uint32_t &r
|
|||||||
// loop forever if informed loop number is negative
|
// loop forever if informed loop number is negative
|
||||||
if (_options.loops >= 0 && loop >= _options.loops) break;
|
if (_options.loops >= 0 && loop >= _options.loops) break;
|
||||||
|
|
||||||
usleep(_options.sleep_ms*1000);
|
px4_usleep(_options.sleep_ms*1000);
|
||||||
++loop;
|
++loop;
|
||||||
}
|
}
|
||||||
@[if send_topics]@
|
@[if send_topics]@
|
||||||
|
|||||||
@@ -36,8 +36,9 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
#include <px4_time.h>
|
||||||
|
|
||||||
#include "microRTPS_transport.h"
|
#include <microRTPS_transport.h>
|
||||||
|
|
||||||
#define DEFAULT_UART "/dev/ttyACM0"
|
#define DEFAULT_UART "/dev/ttyACM0"
|
||||||
|
|
||||||
@@ -326,7 +327,7 @@ int UART_node::init()
|
|||||||
while (0 < ::read(uart_fd, (void *)&aux, 64)) {
|
while (0 < ::read(uart_fd, (void *)&aux, 64)) {
|
||||||
//printf("%s ", aux);
|
//printf("%s ", aux);
|
||||||
flush = true;
|
flush = true;
|
||||||
usleep(1000);
|
px4_usleep(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flush) {
|
if (flush) {
|
||||||
|
|||||||
Reference in New Issue
Block a user