MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / bouncebuffer_setup

Method bouncebuffer_setup

libraries/AP_HAL_ChibiOS/Device.cpp:177–194  ·  view source on GitHub ↗

setup to use DMA-safe bouncebuffers for device transfers */

Source from the content-addressed store, hash-verified

175 setup to use DMA-safe bouncebuffers for device transfers
176 */
177bool DeviceBus::bouncebuffer_setup(const uint8_t *&buf_tx, uint16_t tx_len,
178 uint8_t *&buf_rx, uint16_t rx_len)
179{
180 if (buf_rx) {
181 if (!bouncebuffer_setup_read(bounce_buffer_rx, &buf_rx, rx_len)) {
182 return false;
183 }
184 }
185 if (buf_tx) {
186 if (!bouncebuffer_setup_write(bounce_buffer_tx, &buf_tx, tx_len)) {
187 if (buf_rx) {
188 bouncebuffer_abort(bounce_buffer_rx);
189 }
190 return false;
191 }
192 }
193 return true;
194}
195
196/*
197 complete a transfer using DMA bounce buffer

Callers 3

transferMethod · 0.80
_transferMethod · 0.80
do_transferMethod · 0.80

Calls 3

bouncebuffer_setup_readFunction · 0.85
bouncebuffer_setup_writeFunction · 0.85
bouncebuffer_abortFunction · 0.85

Tested by

no test coverage detected