Skip to content

Commit 6f807c6

Browse files
committed
docu: add poll for WIP finish in example
1 parent 10e9ae7 commit 6f807c6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ world application would be sent this SPI packet to the physically SPI core inste
3131
### Limits
3232

3333
* No timing behavior
34+
* emulated with [WIP](https://github.com/akaeba/spi_flash_model/blob/main/spi_flash_model.h#L32) poll constant
3435

3536

3637
## Releases
@@ -149,6 +150,12 @@ int main ()
149150
spi[8] = 0x89;
150151
spi[9] = 0xAB;
151152
sfm (&spiFlash, spi, 10); // access flash model
153+
// poll for WIP
154+
for ( uint8_t i = 0; i < SFM_WIP_RETRY_IDLE; i++ ) {
155+
spiLen = 2;
156+
spi[0] = 0x05;
157+
sfm(&spiFlash, spi, spiLen); // read state reg, needed for WIP poll
158+
}
152159

153160
/* dump current flash content to check write */
154161
sfm_dump (&spiFlash, 0x0, 0x10);

0 commit comments

Comments
 (0)