SPI updated to eliminate warnings
The same write function works for both 8bit and 16bit transfers, so eliminated the 8bit one and that takes out warnings when the compiler is not sure of the width. Tested with both ILI libraries (_STM and not STM)
This commit is contained in:
parent
92d0470349
commit
d165e4d013
|
@ -324,7 +324,7 @@ void SPIClass::write(uint16 data) {
|
|||
while (spi_is_busy(this->spi_d) != 0); // "... and then wait until BSY=0 before disabling the SPI."
|
||||
}
|
||||
|
||||
void SPIClass::write(uint8 byte) {
|
||||
//void SPIClass::write(uint8 byte) {
|
||||
// this->write(&byte, 1);
|
||||
|
||||
/* Roger Clark
|
||||
|
@ -333,10 +333,10 @@ void SPIClass::write(uint8 byte) {
|
|||
* This almost doubles the speed of this function.
|
||||
*/
|
||||
|
||||
spi_tx_reg(this->spi_d, byte); // "2. Write the first data item to be transmitted into the SPI_DR register (this clears the TXE flag)."
|
||||
while (spi_is_tx_empty(this->spi_d) == 0); // "5. Wait until TXE=1 ..."
|
||||
while (spi_is_busy(this->spi_d) != 0); // "... and then wait until BSY=0 before disabling the SPI."
|
||||
}
|
||||
// spi_tx_reg(this->spi_d, byte); // "2. Write the first data item to be transmitted into the SPI_DR register (this clears the TXE flag)."
|
||||
// while (spi_is_tx_empty(this->spi_d) == 0); // "5. Wait until TXE=1 ..."
|
||||
// while (spi_is_busy(this->spi_d) != 0); // "... and then wait until BSY=0 before disabling the SPI."
|
||||
//}
|
||||
|
||||
void SPIClass::write(const uint8 *data, uint32 length) {
|
||||
uint32 txed = 0;
|
||||
|
|
|
@ -215,7 +215,7 @@ public:
|
|||
* @brief Transmit a byte.
|
||||
* @param data Byte to transmit.
|
||||
*/
|
||||
void write(uint8 data);
|
||||
// void write(uint8 data);
|
||||
|
||||
/**
|
||||
* @brief Transmit a half word.
|
||||
|
|
Loading…
Reference in New Issue