spi: flush stdout

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2018-12-18 20:57:34 -05:00
parent f4ac6ea812
commit 91b4a74dc8

2
spi.c
View File

@ -572,6 +572,7 @@ int spiWrite(struct ff_spi *spi, uint32_t addr, const uint8_t *data, unsigned in
uint32_t erase_addr; uint32_t erase_addr;
for (erase_addr = 0; erase_addr < count; erase_addr += 32768) { for (erase_addr = 0; erase_addr < count; erase_addr += 32768) {
printf("\rErasing @ %06x", erase_addr); printf("\rErasing @ %06x", erase_addr);
fflush(stdout);
spiBegin(spi); spiBegin(spi);
spiCommand(spi, 0x06); spiCommand(spi, 0x06);
spiEnd(spi); spiEnd(spi);
@ -606,6 +607,7 @@ int spiWrite(struct ff_spi *spi, uint32_t addr, const uint8_t *data, unsigned in
printf("\n"); printf("\n");
while (count) { while (count) {
printf("\rProgramming @ %06x", addr); printf("\rProgramming @ %06x", addr);
fflush(stdout);
spiBegin(spi); spiBegin(spi);
spiCommand(spi, 0x06); spiCommand(spi, 0x06);
spiEnd(spi); spiEnd(spi);