mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 19:43:34 +08:00
Nuttx added FIONSPACE and fixed FIONWRITE: had retuned the space and should have returned enqueued count
This commit is contained in:
committed by
Lorenz Meier
parent
81d00e730a
commit
3ed0bfe0d8
@@ -893,9 +893,9 @@ Mavlink::get_free_tx_buf()
|
|||||||
return 1500;
|
return 1500;
|
||||||
|
|
||||||
} else {
|
} 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)
|
#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
|
#else
|
||||||
//Linux cp210x does not support TIOCOUTQ
|
//Linux cp210x does not support TIOCOUTQ
|
||||||
buf_free = 256;
|
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
|
// All termios commands should be silently ignored as they are handled
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
#ifdef FIONSPACE
|
|
||||||
|
|
||||||
case FIONSPACE:
|
case FIONSPACE:
|
||||||
#else
|
|
||||||
case FIONWRITE:
|
|
||||||
#endif
|
|
||||||
*((int *) arg) = _link->_writebuffer.space() * CRTP_MAX_DATA_SIZE;
|
*((int *) arg) = _link->_writebuffer.space() * CRTP_MAX_DATA_SIZE;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user