Commit Graph

140 Commits

Author SHA1 Message Date
Patrick José Pereira fe3d4e2c3b AP_HAL: Utility: Add missing header guard in packetise
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2019-05-20 23:50:23 +01:00
murata dc452d41d2 AP_HAL: Change to shared CRC16 method 2019-04-09 12:50:17 +10:00
Andrew Tridgell 20d762293d AP_HAL: remove more px4 remnants 2019-02-27 20:32:37 +11:00
Andrew Tridgell dcc038dc83 AP_HAL: prevent a zero length leading buffer in peekiovec 2019-02-26 16:18:26 +11:00
Peter Barker 24653a33ed SITL: make socket manipulation functions bool rather than void
... so callers can check if they succeeded or not
2018-12-18 08:51:01 +11:00
Andrew Tridgell 8907506c18 AP_HAL: added replacement for memrchr() 2018-12-06 13:32:09 +11:00
Andrew Tridgell a0be4f4c8d AP_HAL: fixed build and comments 2018-12-06 11:12:40 +11:00
Andrew Tridgell d01f5ae6c8 AP_HAL: added mavlink_packetise()
used for aligning MAVLink packets on UDP on packet boundaries
2018-12-06 11:12:40 +11:00
Andrew Tridgell 9ea03e085d AP_HAL: added readptr() and advance() to ObjectBuffer
this gives a more efficient way of accessing an ObjectBuffer, which
reduces interrupt latency in SoftSigReader
2018-11-07 07:35:45 +11:00
Siddharth Purohit 9a2eea9769 AP_HAL: disable float print methods for non FPU controllers 2018-09-19 12:14:15 +10:00
Peter Barker c846a13d12 AP_HAL: functor: add != override 2018-08-21 20:34:01 +09:00
Hyungsub 6e2076a3f1 AP_HAL: Remove resource leak in srxl.cpp
I correct this issues and then open a pull request.
2018-06-20 11:33:12 +10:00
Peter Barker 584c5d5806 AP_HAL: Socket: add set_cloexec 2018-06-19 09:14:28 +10:00
Francisco Ferreira 695d92ddbf AP_HAL: remove Qualcomm board support 2018-05-17 09:57:20 +10:00
Peter Barker 6c7c916c78 AP_HAL: eliminate AP_HAL::Print and AP_HAL::Stream
Just *way* too many layers involved here
2018-03-23 08:12:38 +11:00
Pierre Kancir f66c83a59e AP_HAL: fix FALLTHROUGH 2018-03-21 08:24:56 +09:00
Andrew Tridgell d030f2888b AP_HAL: added multi-object push to RingBuffer
this is much more efficient than pushing them one at a time
2018-01-20 17:40:07 +11:00
Andrew Tridgell 3f5534eed5 AP_HAL: use calloc in preferance to malloc 2018-01-17 11:22:05 +11:00
Lucas De Marchi 7edde571e1 AP_HAL: RCOutput_Tap: make LEDs blink on non-Aero ESCs
The protocol defines bits for controlling possible LEDs. On Aero the ESC
firmware simply ignores these bits and blink with a fixed frequency.
Add logic to be able to blink the ESC if not flashed with the Aero
version of the firmware.
2017-09-28 08:59:52 -07:00
Lucas De Marchi 2c3054cbae AP_HAL: RCOutput_Tap: remove feedback from ESCs
This is not currently working on Aero, the only user of it right now,
and it has been commented out. Remove dead code.
2017-09-28 08:59:52 -07:00
Lucas De Marchi d3a1ed9792 AP_HAL: RCOutput_Tap: fix comment with protocol bits 2017-09-28 08:59:52 -07:00
fnoop 149188de12 AP_HAL: Add size() method to RingBuffer ObjectArray 2017-09-22 09:56:00 -07:00
fnoop 3ddd9a6bca AP_HAL: RingBuffer: Prefix private members with underscore 2017-09-22 09:55:49 -07:00
Lucas De Marchi 51665a2ea9 AP_HAL: RCOutput_Tap: split baudrate set for Linux and Nuttx
On Linux (and in most of posix-like systems) the baudrate set in struct
termios via cfset[io]speed is actually the index of the standard
baudrates, it's not the baudrate per se (hence the use of B* macros).

On Linux it's possible to set the baudrate by passing the baudrate
itself to TCSETS2 ioctl.  Unfortunately it's not possible to include
asm/termbits.h and termios.h in the same compilation unit, so we need to
split it. Here we split into a Linux and a NuttX implementation.
2017-09-21 07:59:20 -07:00
Lucas De Marchi 58a76adc13 AP_HAL: RCOutput_Tap: allow different device to be used 2017-09-21 07:59:20 -07:00
Lucas De Marchi f6b1099896 AP_HAL: move in tap esc implementation
This can be shared with Linux.
2017-09-21 07:59:20 -07:00
Lucas De Marchi 0e502d89a3 AP_HAL: use FALLTHROUGH define
When falling through on a case switch, allow to add an empty statement
with the correct attribute to tell the compiler this behavior is
intended.
2017-08-22 23:59:13 -07:00
Lucas De Marchi 2e096d76c6 sparse-endian: avoid clash with linux/types.h
On recent kernels (>= 4.10) __bitwise is defined on the header. Avoid
warning about redefining it.
2017-06-02 11:26:02 -07:00
Eugene Shamaev d1792689f1 AP_HAL/utility: clear added to RingBuffer 2017-04-10 21:31:07 +01:00
murata 974d63a6b5 AP_HAL: Change the format of the return value of the method header. 2017-01-09 15:46:03 +00:00
Andrew Tridgell da45aef5c6 AP_HAL: fixed a logic bug in the srxl state machine
when decoding invalid input the buflen could grow to beyond the buffer
size, overwriting the next block of memory. On Disco this ended up
overwriting the Perf::_instance variable, which led to a segmentation
fault
2017-01-09 09:14:13 +11:00
Lucas De Marchi b0ddf81687 Remove stdbool.h include for C++ sources
This header is not needed in our C++ sources.
2016-12-16 11:38:52 -08:00
Andrew Tridgell 5934a099a4 AP_HAL: added support for more SRXL varients
based on work by Roman Seb <roman-29188@gmx.de>
2016-11-24 22:54:23 +11:00
Lucas De Marchi 7968736b1c AP_HAL: add O_CLOEXEC in places missing it
By opening with O_CLOEXEC we make sure we don't leak the file descriptor
when we are exec'ing or calling out subprograms. Right now we currently
don't do it so there's no harm, but it's good practice in Linux to have
it.
2016-11-07 12:37:30 -03:00
murata c808ee2f49 Global: To nullptr from NULL.
RC_Channel: To nullptr from NULL.

AC_Fence: To nullptr from NULL.

AC_Avoidance: To nullptr from NULL.

AC_PrecLand: To nullptr from NULL.

DataFlash: To nullptr from NULL.

SITL: To nullptr from NULL.

GCS_MAVLink: To nullptr from NULL.

DataFlash: To nullptr from NULL.

AP_Compass: To nullptr from NULL.

Global: To nullptr from NULL.

Global: To nullptr from NULL.
2016-11-02 16:04:47 -02:00
Lucas De Marchi 05a7eef1a2 RingBuffer: use explict "if" and return early
Remove confusing use of ternary operator together with assign + load.
No change in behavior.
2016-10-27 10:35:01 -03:00
Murilo Belluzzo 3f1896b9b7 RingBuffer: Remove 'old style' version 2016-10-27 14:24:10 +11:00
Murilo Belluzzo 8526b25654 RingBuffer: Add a faster method to read a single byte 2016-10-27 14:23:42 +11:00
Mathieu OTHACEHE 152edf7189 Global: remove mode line from headers
Using a global .dir-locals.el file is a better alternative than
reincluding the same emacs header in every file of the project.
2016-10-24 09:42:01 -02:00
Andrew Tridgell 8f88d7c784 AP_HAL: fixed comment on XPlus channels
thanks for Francisco for noticing
2016-10-17 06:49:40 +11:00
Andrew Tridgell 4d44591e62 AP_HAL: fixed decoding of XPlus channels 2016-10-16 19:05:19 +11:00
Andrew Tridgell ec8c22f26e AP_HAL: support up to 20 channels on SRXL
tested with 18 channels on a DSM18 transmitter with a AR7700 receiver
with SRXL port
2016-10-16 19:05:19 +11:00
Andrew Tridgell ece0a8721f AP_HAL: added standalone test program for dsm
useful for debugging
2016-10-16 19:05:19 +11:00
Andrew Tridgell 7b3d0234d1 AP_HAL: added an SRXL protocol decoder
SRXL ports are commonly found on newer spektrum receivers like the AR7700
2016-10-16 19:05:18 +11:00
Andrew Tridgell 2edd914634 AP_HAL: added st24 R/C protocol decoder
with thanks to the PX4 project
2016-09-21 10:33:15 -03:00
Andrew Tridgell 9a7af89b30 AP_HAL: added sumd decoder
with thanks to the PX4 project
2016-09-21 10:33:15 -03:00
Murilo Belluzzo 077e03678f Global: Adapt Stream class to be used with Ringbuffer 2016-08-03 01:44:02 -03:00
Murilo Belluzzo b856d26087 RingBuffer: ::set_size now returns true or false 2016-08-03 01:44:02 -03:00
Murilo Belluzzo f7f203efa9 RingBuffer: Add ::clear() method to discard the buffer content
The same could be achieved with ::set_size(::get_size()), but was not
obvious and hurts code readability.
2016-08-03 01:44:02 -03:00
Murilo Belluzzo 75a1b102fb RingBuffer: Handle zero sized better
Sometimes (like in DataFlash) the size of the ring buffer will be
determined in run time and the object can have size zero until proper
initialization. When this was the case, an underflow in ::get_size would
mess with the initializing algorithm.

Another issue was that the 'new' operator could fail what was not being
handled. Now, we only set the size member after we are sure 'new'
successfully allocated memory.
2016-08-03 01:44:02 -03:00