From adbec900184795e3985b8a0dcb38da7c577209c1 Mon Sep 17 00:00:00 2001 From: TSC21 Date: Tue, 1 Jan 2019 23:03:51 +0000 Subject: [PATCH] microRTPS: replace usleep() by px4_usleep() --- msg/templates/uorb_microcdr/microRTPS_client.cpp.template | 4 ++-- msg/templates/urtps/microRTPS_transport.cpp | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/msg/templates/uorb_microcdr/microRTPS_client.cpp.template b/msg/templates/uorb_microcdr/microRTPS_client.cpp.template index 974012d445..762ae88aa9 100644 --- a/msg/templates/uorb_microcdr/microRTPS_client.cpp.template +++ b/msg/templates/uorb_microcdr/microRTPS_client.cpp.template @@ -123,7 +123,7 @@ void* send(void* /*unused*/) } @[end for]@ - usleep(_options.sleep_ms*1000); + px4_usleep(_options.sleep_ms*1000); ++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 if (_options.loops >= 0 && loop >= _options.loops) break; - usleep(_options.sleep_ms*1000); + px4_usleep(_options.sleep_ms*1000); ++loop; } @[if send_topics]@ diff --git a/msg/templates/urtps/microRTPS_transport.cpp b/msg/templates/urtps/microRTPS_transport.cpp index 49a7621366..b0ba11117c 100644 --- a/msg/templates/urtps/microRTPS_transport.cpp +++ b/msg/templates/urtps/microRTPS_transport.cpp @@ -36,8 +36,9 @@ #include #include #include +#include -#include "microRTPS_transport.h" +#include #define DEFAULT_UART "/dev/ttyACM0" @@ -326,7 +327,7 @@ int UART_node::init() while (0 < ::read(uart_fd, (void *)&aux, 64)) { //printf("%s ", aux); flush = true; - usleep(1000); + px4_usleep(1000); } if (flush) {