mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Nuttx added FIONSPACE and fixed FIONWRITE: had retuned the space and should have returned enqueued count
This commit is contained in:
parent
81d00e730a
commit
3ed0bfe0d8
@ -893,9 +893,9 @@ Mavlink::get_free_tx_buf()
|
||||
return 1500;
|
||||
|
||||
} else {
|
||||
// No FIONWRITE on Linux
|
||||
// No FIONSPACE on Linux todo:use SIOCOUTQ and queue size to emulate FIONSPACE
|
||||
#if !defined(__PX4_LINUX) && !defined(__PX4_DARWIN)
|
||||
(void) ioctl(_uart_fd, FIONWRITE, (unsigned long)&buf_free);
|
||||
(void) ioctl(_uart_fd, FIONSPACE, (unsigned long)&buf_free);
|
||||
#else
|
||||
//Linux cp210x does not support TIOCOUTQ
|
||||
buf_free = 256;
|
||||
|
||||
@ -136,12 +136,8 @@ SyslinkBridge::ioctl(struct file *filp, int cmd, unsigned long arg)
|
||||
// All termios commands should be silently ignored as they are handled
|
||||
|
||||
switch (cmd) {
|
||||
#ifdef FIONSPACE
|
||||
|
||||
case FIONSPACE:
|
||||
#else
|
||||
case FIONWRITE:
|
||||
#endif
|
||||
*((int *) arg) = _link->_writebuffer.space() * CRTP_MAX_DATA_SIZE;
|
||||
return 0;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user