Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FastLED/FastLED.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Garcia <danielgarcia@gmail.com>2016-06-07 07:36:57 +0300
committerDaniel Garcia <danielgarcia@gmail.com>2016-06-07 07:36:57 +0300
commit4a71eeabe8ef570de676cc1f57fca599283cde28 (patch)
treeb7c3ac5af4d461381bdf99a2e33feef1fd2c17d7
parent66ae6702aa4bc570cfae8513d873dfb6040af978 (diff)
Kick around the waitFully a bit for the k20 for #313
-rw-r--r--platforms/arm/k20/fastspi_arm_k20.h7
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);
}