Skip to content

Commit 5412558

Browse files
committed
Try to read and send the requested data in chunks
1 parent 70afb80 commit 5412558

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

main.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,12 @@ static void command_loop(void)
231231
uint32_t chunk;
232232
char buf[128];
233233

234-
cs_select(SPI_CS);
235234
for(uint32_t i = 0; i < rlen; i += chunk) {
236235
chunk = MIN(rlen - i, sizeof(buf));
237236
spi_read_blocking(SPI_IF, 0, buf, chunk);
238237
// Send ACK followed by received data
239238
sendbyte_blocking(S_ACK);
240-
sendbytes_blocking(rx_buffer, rlen);
239+
sendbytes_blocking(buf, rlen);
241240
}
242241
cs_deselect(SPI_CS);
243242
break;

0 commit comments

Comments
 (0)