diff options
author | Daniel Garcia <danielgarcia@gmail.com> | 2016-06-07 07:36:57 +0300 |
---|---|---|
committer | Daniel Garcia <danielgarcia@gmail.com> | 2016-06-07 07:36:57 +0300 |
commit | 4a71eeabe8ef570de676cc1f57fca599283cde28 (patch) | |
tree | b7c3ac5af4d461381bdf99a2e33feef1fd2c17d7 | |
parent | 66ae6702aa4bc570cfae8513d873dfb6040af978 (diff) |
Kick around the waitFully a bit for the k20 for #313
-rw-r--r-- | platforms/arm/k20/fastspi_arm_k20.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/platforms/arm/k20/fastspi_arm_k20.h b/platforms/arm/k20/fastspi_arm_k20.h index f342caf8..01b5fc82 100644 --- a/platforms/arm/k20/fastspi_arm_k20.h +++ b/platforms/arm/k20/fastspi_arm_k20.h @@ -276,7 +276,12 @@ public: } static void waitFully() __attribute__((always_inline)) { - while( (SPIX.SR & 0xF000) > 0); + // Wait for the last byte to get shifted into the register + while( (SPIX.SR & 0xF000) > 0) { + // reset the TCF flag + SPIX.SR |= SPI_SR_TCF; + } + // wait for the TCF flag to get set while (!(SPIX.SR & SPI_SR_TCF)); SPIX.SR |= (SPI_SR_TCF | SPI_SR_EOQF); } |