@@ -289,7 +289,11 @@ bool common_hal_busio_spi_write(busio_spi_obj_t *self,
289
289
xfer .dataSize = len ;
290
290
xfer .configFlags = kLPSPI_MasterPcs0 ;
291
291
292
- const status_t status = LPSPI_MasterTransferBlocking (self -> spi , & xfer );
292
+ status_t status ;
293
+ do {
294
+ status = LPSPI_MasterTransferBlocking (self -> spi , & xfer );
295
+ } while (status == kStatus_LPSPI_Busy );
296
+
293
297
if (status != kStatus_Success )
294
298
printf ("%s: status %ld\r\n" , __func__ , status );
295
299
@@ -311,7 +315,11 @@ bool common_hal_busio_spi_read(busio_spi_obj_t *self,
311
315
xfer .rxData = data ;
312
316
xfer .dataSize = len ;
313
317
314
- const status_t status = LPSPI_MasterTransferBlocking (self -> spi , & xfer );
318
+ status_t status ;
319
+ do {
320
+ status = LPSPI_MasterTransferBlocking (self -> spi , & xfer );
321
+ } while (status == kStatus_LPSPI_Busy );
322
+
315
323
if (status != kStatus_Success )
316
324
printf ("%s: status %ld\r\n" , __func__ , status );
317
325
@@ -333,7 +341,11 @@ bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, const uint8_t *data_ou
333
341
xfer .rxData = data_in ;
334
342
xfer .dataSize = len ;
335
343
336
- const status_t status = LPSPI_MasterTransferBlocking (self -> spi , & xfer );
344
+ status_t status ;
345
+ do {
346
+ status = LPSPI_MasterTransferBlocking (self -> spi , & xfer );
347
+ } while (status == kStatus_LPSPI_Busy );
348
+
337
349
if (status != kStatus_Success )
338
350
printf ("%s: status %ld\r\n" , __func__ , status );
339
351
0 commit comments