diff options
author | Daniel Garcia <danielgarcia@gmail.com> | 2014-10-11 04:23:53 +0400 |
---|---|---|
committer | Daniel Garcia <danielgarcia@gmail.com> | 2014-10-11 04:23:53 +0400 |
commit | baf6dfaf9eb1ea4e57956398f42555d0d0e3d828 (patch) | |
tree | 51ff0c4da8872ac5b9c4e414f7d7cb93cea4024a | |
parent | 3cf1699835f982f0aeb728c18bc2119acd52de7b (diff) |
Tweak bit-bang'd SPI timing for running high speed chipsets
-rw-r--r-- | fastspi_bitbang.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fastspi_bitbang.h b/fastspi_bitbang.h index a779ddd3..b596f628 100644 --- a/fastspi_bitbang.h +++ b/fastspi_bitbang.h @@ -105,8 +105,8 @@ private: } public: - #define SPI_DELAY delaycycles< ((SPI_SPEED-2) / 2)>(); - #define SPI_DELAY_HALF delaycycles< ((SPI_SPEED-4) / 4)>(); + #define SPI_DELAY delaycycles<1+((SPI_SPEED-2) / 2)>(); + #define SPI_DELAY_HALF delaycycles<1+ ((SPI_SPEED-4) / 4)>(); // write the BIT'th bit out via spi, setting the data pin then strobing the clcok template <uint8_t BIT> __attribute__((always_inline, hot)) inline static void writeBit(uint8_t b) { |