moved setChipSelect() in front of beginTransactionWithAssertingCS()
This is a more logical order, as beginTransactionWithAssertingCS() and endTransactionWithDeassertingCS() both call it.
This commit is contained in:
parent
41635e3c68
commit
c00ec13218
|
|
@ -282,6 +282,16 @@ void Adafruit_SPIDevice::endTransaction(void) {
|
|||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Assert/Deassert the CS pin if it is defined
|
||||
* @param value The state the CS is set to
|
||||
*/
|
||||
void Adafruit_SPIDevice::setChipSelect(int value) {
|
||||
if (_cs != -1) {
|
||||
digitalWrite(_cs, value);
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Write a buffer or two to the SPI device, with transaction
|
||||
* management.
|
||||
|
|
@ -510,14 +520,4 @@ bool Adafruit_SPIDevice::write_and_read(uint8_t *buffer, size_t len) {
|
|||
return true;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Assert/Deassert the CS pin if it is defined
|
||||
* @param value The state the CS is set to
|
||||
*/
|
||||
void Adafruit_SPIDevice::setChipSelect(int value) {
|
||||
if (_cs == -1)
|
||||
return;
|
||||
digitalWrite(_cs, value);
|
||||
}
|
||||
|
||||
#endif // SPI exists
|
||||
|
|
|
|||
Loading…
Reference in New Issue