forked from Archive/PX4-Autopilot
microRTPS readability braces
This commit is contained in:
parent
2151890e50
commit
5b1e3b3257
|
@ -312,10 +312,11 @@ static int micrortps_start(int argc, char *argv[])
|
|||
case @(message_id(topic)):
|
||||
{
|
||||
deserialize_@(topic)(&@(topic)_data, data_buffer, µCDRReader);
|
||||
if (!@(topic)_pub)
|
||||
if (!@(topic)_pub) {
|
||||
@(topic)_pub = orb_advertise(ORB_ID(@(topic)), &@(topic)_data);
|
||||
else
|
||||
} else {
|
||||
orb_publish(ORB_ID(@(topic)), @(topic)_pub, &@(topic)_data);
|
||||
}
|
||||
++received;
|
||||
}
|
||||
break;
|
||||
|
@ -335,7 +336,7 @@ static int micrortps_start(int argc, char *argv[])
|
|||
}
|
||||
@[if send_topics]@
|
||||
_should_exit_task = true;
|
||||
pthread_join(sender_thread, 0);
|
||||
pthread_join(sender_thread, nullptr);
|
||||
@[end if]@
|
||||
|
||||
struct timespec end;
|
||||
|
|
|
@ -298,8 +298,14 @@ int UART_node::init()
|
|||
flush = true;
|
||||
usleep(1000);
|
||||
}
|
||||
if (flush) printf("flush\n");
|
||||
else printf("no flush\n");
|
||||
if (flush)
|
||||
{
|
||||
printf("flush\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("no flush\n");
|
||||
}
|
||||
|
||||
poll_fd[0].fd = uart_fd;
|
||||
poll_fd[0].events = POLLIN;
|
||||
|
@ -359,7 +365,9 @@ UDP_node::~UDP_node()
|
|||
int UDP_node::init()
|
||||
{
|
||||
if (0 > init_receiver(udp_port_recv) || 0 > init_sender(udp_port_send))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue