changeset 3258:b44dec9cc8b9

Fix: Kinetis DSPI infinite polling [ Bugzilla 10011879 ], reported by Mike Jones
author vae
date Tue, 09 Jul 2013 20:50:08 +0000
parents b3010a200e62
children 8ecac279f33c
files packages/devs/spi/freescale/dspi/current/ChangeLog packages/devs/spi/freescale/dspi/current/src/spi_freescale_dspi.c
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/packages/devs/spi/freescale/dspi/current/ChangeLog
+++ b/packages/devs/spi/freescale/dspi/current/ChangeLog
@@ -1,3 +1,8 @@
+2013-07-09  Mike Jones <mjones@proclivis.com>
+
+	* src/spi_freescale_dspi.c: Fix: Kinetis DSPI infinite polling
+	[ Bugzilla 10011879 ]
+
 2013-05-08  Ilija Kocho <ilijak@siva.com.mk>
 
 	* src/spi_freescale_dspi.cdl: Add CYGINT_DEVS_SPI_DMA_USE
--- a/packages/devs/spi/freescale/dspi/current/src/spi_freescale_dspi.c
+++ b/packages/devs/spi/freescale/dspi/current/src/spi_freescale_dspi.c
@@ -1038,8 +1038,8 @@ static void dspi_transaction_end(cyg_spi
         // Clear peripheral CS by executing a dummy 4 bit transfer.
         dspi_p->pushr = PUSHR_NULL | FREESCALE_DSPI_PUSHR_EOQ_M |
                         FREESCALE_DSPI_PUSHR_CTAS(1);
+        while(!(dspi_p->sr & FREESCALE_DSPI_SR_EOQF_M));
         DSPI_EOQ_CLEAR(dspi_p);
-        while(!(dspi_p->sr & FREESCALE_DSPI_SR_EOQF_M));
         dspi_fifo_drain(dspi_p);
         dspi_device->chip_sel = 0;
     }