mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 23:53:34 +08:00
move sleep to then end of the loop
This commit is contained in:
committed by
Lorenz Meier
parent
833ee4ba7f
commit
bf6328001d
@@ -93,8 +93,6 @@ void task_main(int argc, char *argv[])
|
|||||||
// Main loop
|
// Main loop
|
||||||
while (!_task_should_exit) {
|
while (!_task_should_exit) {
|
||||||
|
|
||||||
// sleep since no poll
|
|
||||||
usleep(10000);
|
|
||||||
int newbytes = ::read(uart_fd, &rx_buf[0], sizeof(rx_buf));
|
int newbytes = ::read(uart_fd, &rx_buf[0], sizeof(rx_buf));
|
||||||
|
|
||||||
if (newbytes < 0) {
|
if (newbytes < 0) {
|
||||||
@@ -137,6 +135,10 @@ void task_main(int argc, char *argv[])
|
|||||||
orb_publish(ORB_ID(input_rc), rc_pub, &input_rc);
|
orb_publish(ORB_ID(input_rc), rc_pub, &input_rc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// sleep since no poll for qurt
|
||||||
|
usleep(10000);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
orb_unadvertise(rc_pub);
|
orb_unadvertise(rc_pub);
|
||||||
|
|||||||
Reference in New Issue
Block a user