mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-14 03:50:02 +03:00
Fix chaining of FLASH SPI transactions
This commit is contained in:
parent
8462dd1bea
commit
8474a6eb7d
1 changed files with 7 additions and 0 deletions
|
@ -356,6 +356,13 @@ static uint32_t m25p16_pageProgramContinue(flashDevice_t *fdevice, uint8_t const
|
||||||
segments[DATA1].len = bufferSizes[0];
|
segments[DATA1].len = bufferSizes[0];
|
||||||
fdevice->callbackArg = bufferSizes[0];
|
fdevice->callbackArg = bufferSizes[0];
|
||||||
|
|
||||||
|
/* As the DATA2 segment may be used as the terminating segment, the rxData and txData may be overwritten
|
||||||
|
* with a link to the following transaction (u.link.dev and u.link.segments respectively) so ensure that
|
||||||
|
* rxData is reinitialised otherwise it will remain pointing at a chained u.link.segments structure which
|
||||||
|
* would result in it being corrupted.
|
||||||
|
*/
|
||||||
|
segments[DATA2].u.buffers.rxData = (uint8_t *)NULL;
|
||||||
|
|
||||||
if (bufferCount == 1) {
|
if (bufferCount == 1) {
|
||||||
segments[DATA1].negateCS = true;
|
segments[DATA1].negateCS = true;
|
||||||
segments[DATA1].callback = m25p16_callbackWriteComplete;
|
segments[DATA1].callback = m25p16_callbackWriteComplete;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue