mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 09:28:58 +00:00
Merge remote-tracking branch 'px4/ekf_home_init' into navigator_cleanup_ekf_home_init
Conflicts: src/modules/commander/commander.cpp src/modules/mc_pos_control/mc_pos_control_main.cpp src/modules/navigator/navigator_main.cpp src/modules/uORB/topics/vehicle_global_position.h
This commit is contained in:
@@ -189,9 +189,18 @@ mavlink_send_uart_bytes(mavlink_channel_t channel, const uint8_t *ch, int length
|
||||
/* If the wait until transmit flag is on, only transmit after we've received messages.
|
||||
Otherwise, transmit all the time. */
|
||||
if (instance->should_transmit()) {
|
||||
ssize_t ret = write(uart, ch, desired);
|
||||
|
||||
/* check if there is space in the buffer, let it overflow else */
|
||||
if (!ioctl(uart, FIONWRITE, (unsigned long)&buf_free)) {
|
||||
|
||||
if (desired > buf_free) {
|
||||
desired = buf_free;
|
||||
}
|
||||
}
|
||||
|
||||
ssize_t ret = write(uart, ch, desired);
|
||||
if (ret != desired) {
|
||||
// XXX do something here, but change to using FIONWRITE and OS buf size for detection
|
||||
warnx("TX FAIL");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user