mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 08:15:30 +03:00
Allow for HALF/NOMINAL/DOUBLE frequency of MAX7456 SPI clock
This commit is contained in:
parent
96ac7953ae
commit
5ef34f79d5
16 changed files with 101 additions and 168 deletions
|
@ -288,7 +288,7 @@ static void m25p16_eraseSector(flashDevice_t *fdevice, uint32_t address)
|
|||
};
|
||||
|
||||
// Ensure any prior DMA has completed before continuing
|
||||
spiWaitClaim(fdevice->io.handle.dev);
|
||||
spiWait(fdevice->io.handle.dev);
|
||||
|
||||
m25p16_setCommandAddress(§orErase[1], address, fdevice->isLargeFlash);
|
||||
|
||||
|
@ -312,9 +312,6 @@ static void m25p16_eraseCompletely(flashDevice_t *fdevice)
|
|||
{NULL, NULL, 0, true, NULL},
|
||||
};
|
||||
|
||||
// Ensure any prior DMA has completed before continuing
|
||||
spiWaitClaim(fdevice->io.handle.dev);
|
||||
|
||||
spiSequence(fdevice->io.handle.dev, segments);
|
||||
|
||||
// Block pending completion of SPI access, but the erase will be ongoing
|
||||
|
@ -346,7 +343,7 @@ static uint32_t m25p16_pageProgramContinue(flashDevice_t *fdevice, uint8_t const
|
|||
};
|
||||
|
||||
// Ensure any prior DMA has completed before continuing
|
||||
spiWaitClaim(fdevice->io.handle.dev);
|
||||
spiWait(fdevice->io.handle.dev);
|
||||
|
||||
// Patch the pageProgram segment
|
||||
segments[PAGE_PROGRAM].len = fdevice->isLargeFlash ? 5 : 4;
|
||||
|
@ -427,7 +424,7 @@ static int m25p16_readBytes(flashDevice_t *fdevice, uint32_t address, uint8_t *b
|
|||
STATIC_DMA_DATA_AUTO uint8_t readBytes[5] = { M25P16_INSTRUCTION_READ_BYTES };
|
||||
|
||||
// Ensure any prior DMA has completed before continuing
|
||||
spiWaitClaim(fdevice->io.handle.dev);
|
||||
spiWait(fdevice->io.handle.dev);
|
||||
|
||||
busSegment_t segments[] = {
|
||||
{readStatus, readyStatus, sizeof(readStatus), true, m25p16_callbackReady},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue