mirror of https://github.com/ArduPilot/ardupilot
e3b676ba89
Modify ByteBuffer class to have a `peekiovec()` method, that takes in a `struct IoVec` array (similar to `struct iovec` from POSIX), and a number of bytes, and returns the number of elements from this array that have been filled out. It is either 0 (buffer is empty), 1 (there's enough contiguous bytes to read that amount) or 2 (ring buffer is wrapping around). This enables using scatter-gather I/O (i.e. writev()), removing calls to memcpy(). That's one call when no wrap-around is happening, and two calls if it is. Also, rewrite `ByteBuffer::peekbytes()` to use `peekiovec()`, so that some of the checks performed by the former are not replicated in the latter. |
||
---|---|---|
.. | ||
examples | ||
utility | ||
AP_HAL.h | ||
AP_HAL_Boards.h | ||
AP_HAL_Macros.h | ||
AP_HAL_Main.h | ||
AP_HAL_Namespace.h | ||
AnalogIn.h | ||
Device.h | ||
GPIO.h | ||
HAL.cpp | ||
HAL.h | ||
I2CDevice.h | ||
I2CDriver.h | ||
OpticalFlow.h | ||
RCInput.h | ||
RCOutput.h | ||
SPIDevice.h | ||
SPIDriver.h | ||
Scheduler.h | ||
Semaphores.h | ||
Storage.h | ||
UARTDriver.cpp | ||
UARTDriver.h | ||
Util.cpp | ||
Util.h | ||
system.h |