ardupilot/libraries/AP_HAL
Leandro Pereira fbefe32017 AP_HAL: Add method to reserve space in the ring buffer
Adds a method called `reserve()`, that will take a ByteBuffer::IoVec
array of at least two elements, and return the number of elements
filled out.  0 will be returned if `len` is over the total space of
the buffer; 1 will be returned if there's enough contiguous bytes in
the buffer; 2 will be returned if there are two non-contiguous blocks
of memory.

This method is suitable to be used with POSIX system calls such as
readv(), and is an optimization to not require temporary memory copies
while reading from a file descriptor.

Also modify the write() method to use reserve(), so that similar checks
are performed only in one place.
2016-07-08 13:10:16 -03:00
..
examples AP_HAL: fix signed and unsigned comparison warning 2016-05-04 08:58:37 -03:00
utility AP_HAL: Add method to reserve space in the ring buffer 2016-07-08 13:10:16 -03:00
AnalogIn.h AP_HAL: replace header guard with pragma once 2016-02-18 14:52:34 -02:00
AP_HAL_Boards.h AP_HAL: added hal.util->set_imu_target_temp() API 2016-07-01 15:29:52 +10:00
AP_HAL_Macros.h AP_HAL: replace header guard with pragma once 2016-02-18 14:52:34 -02:00
AP_HAL_Main.h AP_HAL: remove support for main without argc 2016-05-23 21:49:45 -03:00
AP_HAL_Namespace.h AP_HAL: Remove trailing spaces from AP_HAL_Namespace.h 2016-06-22 16:03:30 -03:00
AP_HAL.h AP_HAL: Add support for an Optflow driver 2015-12-18 17:56:03 +11:00
Device.h Global: rename bus type enum entries 2016-06-27 17:51:41 -03:00
GPIO.h AP_HAL: GPIO: remove unused functions 2016-06-21 12:16:32 -03:00
HAL.cpp AP_HAL: add run() method 2015-10-21 09:16:07 +11:00
HAL.h AP_HAL: added uartF 2016-04-20 09:39:48 +10:00
I2CDevice.h Global: rename bus type enum entries 2016-06-27 17:51:41 -03:00
I2CDriver.h AP_HAL: Fix typos 2016-05-13 19:20:06 -03:00
OpticalFlow.h AP_HAL: follow coding style 2015-12-18 17:56:03 +11:00
RCInput.h AP_HAL: fixed typo 2016-07-01 15:35:07 +10:00
RCOutput.h AP_HAL: defer calls to safety_state switch to queue an async attempt. 2016-05-27 21:34:40 +10:00
Scheduler.h AP_HAL: replace header guard with pragma once 2016-02-18 14:52:34 -02:00
Semaphores.h AP_HAL: replace header guard with pragma once 2016-02-18 14:52:34 -02:00
SPIDevice.h Global: rename bus type enum entries 2016-06-27 17:51:41 -03:00
SPIDriver.h AP_HAL: add interface for SPIDevice devices 2016-02-16 19:49:09 -02:00
Storage.h AP_HAL: replace header guard with pragma once 2016-02-18 14:52:34 -02:00
system.h Global: Rename printf format attribute 2015-12-01 07:22:12 +11:00
UARTDriver.cpp AP_HAL: remove unused in_progmem flag to print_vprintf 2015-12-27 15:58:12 -02:00
UARTDriver.h AP_HAL: fixed typo 2016-07-01 15:35:07 +10:00
Util.cpp AP_HAL: add support for get realtime on Darwin systems 2016-07-07 11:35:17 -03:00
Util.h AP_HAL: fixed typo 2016-07-01 15:35:07 +10:00