File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -228,16 +228,14 @@ static void command_loop(void)
228
228
sendbyte_blocking (S_ACK );
229
229
230
230
// Handle receive operation in chunks
231
- while (rlen > 0 ) {
232
- uint32_t chunk_size = (rlen < MAX_BUFFER_SIZE ) ? rlen : MAX_BUFFER_SIZE ;
231
+ uint32_t chunk_size = (rlen < MAX_BUFFER_SIZE ) ? rlen : MAX_BUFFER_SIZE ;
233
232
234
- cs_select (SPI_CS );
235
- spi_read_blocking (SPI_IF , 0 , rx_buffer , chunk_size );
236
- cs_deselect (SPI_CS );
233
+ cs_select (SPI_CS );
234
+ spi_read_blocking (SPI_IF , 0 , rx_buffer , chunk_size );
235
+ cs_deselect (SPI_CS );
237
236
238
- sendbytes_blocking (rx_buffer , chunk_size );
239
- rlen -= chunk_size ;
240
- }
237
+ sendbytes_blocking (rx_buffer , chunk_size );
238
+ rlen -= chunk_size ;
241
239
cs_deselect (SPI_CS );
242
240
break ;
243
241
}
You can’t perform that action at this time.
0 commit comments