Brad Bosch
6e9756ff79
HAL_PX4: Rework support for FLOW_CONTROL_AUTO.
...
Now instead of requiring the buffer to fill completely before we can
detect it is not draining, we use a time based mechanism to detect
when none of the first few bytes are transmitted after sitting in our
buffer a half second or more after flow control is enabled. This
huristic is reliable only for the first several chracters because we
believe that the radio must still have plenty of room in it's own
buffers at that time even if it is not able to transmit them to the
other radio yet. Note that the original algorithm made the same
assumption.
The new algorithm is especially helpful for cases where only keepalive
messages are transmitted before other packets can be requested by the
GCS. In this situation, the original code required almost 2 minutes
to disable flow control and allow communication with the GCS.
2015-08-19 15:21:10 +10:00
Lucas De Marchi
83cfaf4a59
AP_HAL_PX4: standardize inclusion of libaries headers
...
Do the missing header changes due to changing the code before the pr
getting accepted.
2015-08-18 17:12:51 +10:00
Gustavo Jose de Sousa
08333f1ffe
AP_HAL_PX4: standardize inclusion of libaries headers
...
This commit changes the way libraries headers are included in source files:
- If the header is in the same directory the source belongs to, so the
notation '#include ""' is used with the path relative to the directory
containing the source.
- If the header is outside the directory containing the source, then we use
the notation '#include <>' with the path relative to libraries folder.
Some of the advantages of such approach:
- Only one search path for libraries headers.
- OSs like Windows may have a better lookup time.
2015-08-11 16:28:43 +10:00
Andrew Tridgell
1b61f6f636
HAL_PX4: fixed USB connected on AUAV-X2
...
this is the 2nd attempt at a fix for the usb_connected status on
AUAV-X2
2015-08-11 11:42:02 +10:00
Tom Pittenger
179c72bfa9
HAL_PX4: fix compile warning re member init order
2015-04-24 14:14:38 +09:00
Andrew Tridgell
7cd7ff89fd
HAL_PX4: recover 12k of ram from USB buffers
...
faster NuttX means we don't need such larger buffers
2015-03-27 15:08:52 -07:00
Jonathan Challinger
e908fcafb1
AP_HAL_PX4: attempt to initialize USB while soft-disarmed
2015-02-11 20:57:27 +11:00
Andrew Tridgell
464714f1ab
HAL_PX4: fixed build warning
2015-01-09 11:37:46 +11:00
Andrew Tridgell
0c73dc2440
HAL_PX4: use common RingBuffer.h
2015-01-07 08:41:14 +11:00
Matthias Badaire
1d3a49e466
AP_HAL_PX4 : make UARTDriver capable to be called from different threads.
...
The modification allows the read and write functions to be called by any thread but the calling thread must be the last one that called the begin() function.
2014-11-14 13:51:16 +11:00
Andrew Tridgell
10b0ca7ea8
HAL_PX4: reduce the number of times we split up UART reads and writes
2014-10-09 12:29:25 +11:00
Andrew Tridgell
48247b6adc
HAL_PX4: minimise usage of hrt_absolute_time()
2014-08-20 09:10:24 +10:00
Andrew Tridgell
0a20d0db60
HAL_PX4: prevent read past end of buffer
2014-08-19 10:08:17 +10:00
Andrew Tridgell
a7d6a26bec
HAL_PX4: fixed auto-flow control
...
the 6 bytes written to break the radio out of bootloader broke
auto flowcontrol detection
2014-05-19 22:02:39 +10:00
Andrew Tridgell
4e2e685d7a
HAL_PX4: better fix for IFLOW on all ports
...
the tcsetattr() call fails to apply the baudrate if the port has no
RTS pin and we ask for IFLOW. So just make a separate call.
2014-02-12 17:47:23 +11:00
Andrew Tridgell
b2cdd39a99
HAL_PX4: don't enable IFLOW on ports without flow control
...
this should have been harmless, but breaks the GPS on Pixhawk. This
disables it until we work out why.
2014-02-12 17:32:07 +11:00
Andrew Tridgell
c5c1d1358a
HAL_PX4: added automatic hardware flow control detection
...
this allows us to detect if hardware flow control is not available and
automatically disable it
2014-02-11 12:11:26 +11:00
Andrew Tridgell
3e637ac5d9
AP_HAL: added enable_flow_control() option in AP_HAL
2014-02-10 12:54:50 +11:00
Andrew Tridgell
a95868e124
HAL_PX4: even larger tx buffer size for faster log transfer
2013-12-28 16:01:48 +11:00
Andrew Tridgell
ff7004fcc5
HAL_PX4: use larger buffers on USB
2013-12-28 14:25:54 +11:00
Andrew Tridgell
0b25ff0a16
HAL_PX4: added uartD
2013-11-23 19:29:22 +11:00
Andrew Tridgell
24d1cf3bd6
HAL_PX4: don't check USB for data if not connected
2013-11-05 14:41:42 +11:00
Andrew Tridgell
e34cc6dd9a
HAL_PX4: added some UART debugging
...
this may help to track down USB issues
2013-10-13 12:43:25 +11:00
Andrew Tridgell
ad30f8effa
HAL_PX4: try to reopen UARTs if safety switch is disarmed
...
this allows attaching to the USB port after power on
Pair-Programmed-With: Randy Mackay <rmackay9@yahoo.com>
2013-10-05 15:47:28 +10:00
Andrew Tridgell
7067569103
HAL_PX4: fixed end() on UARTs
2013-09-29 12:04:36 +10:00
Andrew Tridgell
40af9ab674
AP_HAL_PX4: updates for new API
2013-09-22 12:22:05 +10:00
Andrew Tridgell
05b426c1fc
HAL_PX4: use common printf implementation on UARTs
2013-09-21 14:23:52 +10:00
Andrew Tridgell
2340bb6220
PX4: use a minimum transmit buffer for UARTs of 512 bytes
...
this avoids writes stalling on the GPS port. We can't afford this
memory on APM2, but we can on PX4, and it means that while the GPS is
blocking at startup it doesn't cause any scheduler slips
2013-08-30 13:01:33 +10:00
Andrew Tridgell
0916388ab5
HAL_PX4: retry opening UARTs up to 5 times
...
this seems to help a lot with the USB port on PX4
2013-07-11 13:50:23 +10:00
Andrew Tridgell
8766e86091
HAL_PX4: fixed blocking bulk writes to UARTs
...
this fixes a problem with uBlox initialisation on PX4
2013-03-20 15:41:52 +11:00
Andrew Tridgell
14911eff6c
HAL_PX4: added a (disabled) trick for handling blocking ttyACM0
...
this doesn't work yet, but is worth having for debugging
2013-03-20 11:20:43 +11:00
Andrew Tridgell
c373429a6e
HAL_PX4: fixed a buffer handling bug
...
BUF_SPACE() was badly buggy, which could lead to memory corruption
2013-02-20 18:15:56 +11:00
Andrew Tridgell
54e7bce75e
HAL_PX4: cope with O_NONBLOCK not working in NuttX on ttyACM0
...
writes will block anyway, which clags up APM
2013-02-19 12:02:46 +11:00
Andrew Tridgell
fc8065b50f
HAL_PX4: added UART performance counters
2013-01-24 15:04:57 +11:00
Andrew Tridgell
f72b532405
HAL_PX4: ensure all writes go via buffers
...
this prevents output corruption by direct fd writes
2013-01-23 09:22:51 +11:00
Andrew Tridgell
89cb3fbd61
HAL_PX4: fixed blocking IO in UART driver
2013-01-22 21:52:21 +11:00
Andrew Tridgell
6ffa18fa61
HAL_PX4: rewrite UART driver to be much more efficient
...
this does the IO in the timer thread, and uses buffers in the main
task to avoid system call costs in the flight code.
The cost of PX4 read and write system calls is quite high - about 10
to 15 usec. We can't afford to pay that per byte
2013-01-22 21:22:01 +11:00
Andrew Tridgell
546ed19ffc
HAL_PX4: improved efficiency of serial writes
...
use buffer at a time writes when possible, and use O_NONBLOCKING to
avoid txspace()
2013-01-22 10:50:26 +11:00
Andrew Tridgell
18cfd29f2f
HAL_PX4: added a read buffer to the UART driver
...
this lowers the average cost of reading bytes by a large amount, and
prevents the GPS driver from chewing lots of time.
2013-01-22 10:34:04 +11:00
Andrew Tridgell
76092eb590
AP_HAL: remove unused peek() interface from UART drivers
...
this is a bit tricky to implement on some platforms, and is unused
anyway
2013-01-16 14:43:18 +11:00
Andrew Tridgell
64a8a8e4c9
HAL_PX4: fixed using mavlink on the console
...
this disables the ONLCR termios flag, which was injecting extra
carriage returns in the output
2013-01-14 16:21:27 +11:00
Andrew Tridgell
30447018d5
HAL_PX4: handle %S in format strings
2013-01-05 08:10:07 +11:00
Andrew Tridgell
08d518e07f
HAL_PX4: switch to libc vdprintf()
...
vdprintf has now been added to NuttX
2013-01-05 08:01:10 +11:00
Andrew Tridgell
44837a11f2
HAL_PX4: added baudrate support to UART driver
2013-01-04 19:42:30 +11:00
Andrew Tridgell
155fca8a4b
HAL_PX4: make APM sketches into daemons
...
this also moves uartA onto UART5, allowing ttyS0 for nsh
2013-01-04 11:14:35 +11:00
Andrew Tridgell
d492b72a2c
HAL_PX4: use /dev/ttyS0 for uartA
...
this also changes txspace and available to use FIONWRITE and FIONREAD
2013-01-03 21:12:10 +11:00
Andrew Tridgell
c6c336a6e8
HAL_PX4: implement peek() and available()
...
keep a 1 byte buffer
2013-01-03 17:27:53 +11:00
Andrew Tridgell
d9d5eb52bf
HAL_PX4: use fd IO instead of stdio
...
this allows for hal console output from within timers, which is very
handy for debugging
2013-01-03 13:16:41 +11:00
Andrew Tridgell
9373a4e5b3
HAL_PX4: added a uartA driver
...
uses stdin/stdout for IO
2013-01-03 11:03:05 +11:00