mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-12 19:10:32 +03:00
clarifications after code review.
This commit is contained in:
parent
7691ea85f4
commit
96bd3c3405
2 changed files with 5 additions and 5 deletions
|
@ -503,9 +503,9 @@ static void spiPreInitStream(const extDevice_t *dev)
|
||||||
{
|
{
|
||||||
// Prepare the init structure for the next segment to reduce inter-segment interval
|
// Prepare the init structure for the next segment to reduce inter-segment interval
|
||||||
// (if it's a "buffers" segment, not a "link" segment).
|
// (if it's a "buffers" segment, not a "link" segment).
|
||||||
busSegment_t *segment = (busSegment_t *)dev->bus->curSegment + 1;
|
busSegment_t *nextSegment = (busSegment_t *)dev->bus->curSegment + 1;
|
||||||
if (segment->len > 0) {
|
if (nextSegment->len > 0) {
|
||||||
spiInternalInitStream(dev, segment);
|
spiInternalInitStream(dev, nextSegment);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -357,8 +357,8 @@ void spiInternalInitStream(const extDevice_t *dev, volatile busSegment_t *segmen
|
||||||
// To keep everything uniform (always both TX and RX channels active, callback always on RX completion), if there is
|
// To keep everything uniform (always both TX and RX channels active, callback always on RX completion), if there is
|
||||||
// no TX or RX buffer to read from / write to, treat as a single dummy byte with no increment.
|
// no TX or RX buffer to read from / write to, treat as a single dummy byte with no increment.
|
||||||
// (cf. same idea on other platform implementations)
|
// (cf. same idea on other platform implementations)
|
||||||
bool isTX = segment->u.buffers.txData;
|
bool isTX = segment->u.buffers.txData != NULL;
|
||||||
bool isRX = segment->u.buffers.rxData;
|
bool isRX = segment->u.buffers.rxData != NULL;
|
||||||
|
|
||||||
dma_channel_config config = dma_channel_get_default_config(bus->dmaTx->channel);
|
dma_channel_config config = dma_channel_get_default_config(bus->dmaTx->channel);
|
||||||
channel_config_set_transfer_data_size(&config, DMA_SIZE_8);
|
channel_config_set_transfer_data_size(&config, DMA_SIZE_8);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue