diff options
author | Daniel Garcia <danielgarcia@gmail.com> | 2015-01-30 21:12:06 +0300 |
---|---|---|
committer | Daniel Garcia <danielgarcia@gmail.com> | 2015-01-30 21:12:06 +0300 |
commit | 60051c70a923112a3d3362080bb1d291ac7b4755 (patch) | |
tree | 0edb833fb5f986e7d84547c63b9b4dbe4a73cd6a | |
parent | 7b4cdb21643729abc3021674c59ec6d3d83319bc (diff) |
Fix software SPI on the teensy 3.1 for APA102.
-rw-r--r-- | fastspi_bitbang.h | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/fastspi_bitbang.h b/fastspi_bitbang.h index b596f628..4da32f63 100644 --- a/fastspi_bitbang.h +++ b/fastspi_bitbang.h @@ -112,20 +112,12 @@ public: template <uint8_t BIT> __attribute__((always_inline, hot)) inline static void writeBit(uint8_t b) { if(b & (1 << BIT)) { FastPin<DATA_PIN>::hi(); - if(SPI_SPEED < 3) { - FastPin<CLOCK_PIN>::strobe(); - } else { - FastPin<CLOCK_PIN>::hi(); SPI_DELAY; - FastPin<CLOCK_PIN>::lo(); SPI_DELAY; - } + FastPin<CLOCK_PIN>::hi(); SPI_DELAY; + FastPin<CLOCK_PIN>::lo(); SPI_DELAY; } else { FastPin<DATA_PIN>::lo(); - if(SPI_SPEED < 3) { - FastPin<CLOCK_PIN>::strobe(); - } else { - FastPin<CLOCK_PIN>::hi(); SPI_DELAY; - FastPin<CLOCK_PIN>::lo(); SPI_DELAY; - } + FastPin<CLOCK_PIN>::hi(); SPI_DELAY; + FastPin<CLOCK_PIN>::lo(); SPI_DELAY; } } |