arduino-dataflash icon indicating copy to clipboard operation
arduino-dataflash copied to clipboard

BufferToPage should block at beginning, not end

Open kolosy opened this issue 13 years ago • 2 comments

The BufferToPage method currently initiates the ram -> flash transfer and blocks until completion. this should be reversed. the reason the device has two ram buffers is so that you could continuously write data to it without having the consumer wait for the flush operation.

it should be

function BufferToPage(number) while (busy) wait;

initiateTransfer(number) return

and the operations that read flash directly should wait as well. this way, if i'm writing a chunk of data that's larget than the ram buffer, i can initiate the flush, pop out, switch ram buffers and keep writing. the time necessary to flush a buffer to flash is less than the time necessary to fill a ram buffer.

kolosy avatar Jul 19 '11 21:07 kolosy

because of this change, you need to introduce checks into any function that touches the flash, including ReadMainMemoryPage and ContinuousRead. The reason is that before you couldn't have a situation where you were trying to read the flash while it was busy, but now you can.

kolosy avatar Nov 05 '11 20:11 kolosy

I'm thinking about making DataFlash::enable call waitUntilReady before setting CS pin low.

BlockoS avatar Sep 19 '12 19:09 BlockoS