From e6db70e3cc33628756c428462ee0059cfb3dd894 Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Sat, 13 Apr 2019 14:55:42 -0700 Subject: [PATCH] Redoing _cs >= 0 --- Adafruit_SPITFT.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Adafruit_SPITFT.cpp b/Adafruit_SPITFT.cpp index c21b760..d866bc3 100644 --- a/Adafruit_SPITFT.cpp +++ b/Adafruit_SPITFT.cpp @@ -1640,7 +1640,7 @@ uint16_t Adafruit_SPITFT::color565(uint8_t red, uint8_t green, uint8_t blue) { */ void Adafruit_SPITFT::sendCommand(uint8_t commandByte, uint8_t *dataBytes, uint8_t numDataBytes) { SPI_BEGIN_TRANSACTION(); - if(_cs > 0) SPI_CS_LOW(); + if(_cs >= 0) SPI_CS_LOW(); SPI_DC_LOW(); // Command mode spiWrite(commandByte); // Send the command byte @@ -1651,7 +1651,7 @@ void Adafruit_SPITFT::sendCommand(uint8_t commandByte, uint8_t *dataBytes, uint8 dataBytes++; } - if(_cs > 0) SPI_CS_HIGH(); + if(_cs >= 0) SPI_CS_HIGH(); SPI_END_TRANSACTION(); } @@ -1663,7 +1663,7 @@ void Adafruit_SPITFT::sendCommand(uint8_t commandByte, uint8_t *dataBytes, uint8 */ void Adafruit_SPITFT::sendCommand(uint8_t commandByte, const uint8_t *dataBytes, uint8_t numDataBytes) { SPI_BEGIN_TRANSACTION(); - if(_cs > 0) SPI_CS_LOW(); + if(_cs >= 0) SPI_CS_LOW(); SPI_DC_LOW(); // Command mode spiWrite(commandByte); // Send the command byte @@ -1673,7 +1673,7 @@ void Adafruit_SPITFT::sendCommand(uint8_t commandByte, const uint8_t *dataBytes, spiWrite(pgm_read_byte(dataBytes++)); // Send the data bytes } - if(_cs > 0) SPI_CS_HIGH(); + if(_cs >= 0) SPI_CS_HIGH(); SPI_END_TRANSACTION(); }