Merge pull request #83 from adafruit/revert-77-master
Revert "Faster hardware SPI writes on SAMD"
This commit is contained in:
commit
538b07a070
|
|
@ -312,22 +312,6 @@ bool Adafruit_SPIDevice::write(uint8_t *buffer, size_t len,
|
||||||
_spi->transferBytes(buffer, nullptr, len);
|
_spi->transferBytes(buffer, nullptr, len);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#elif defined(ARDUINO_ARCH_SAMD) && defined(_ADAFRUIT_ZERODMA_H_)
|
|
||||||
// The variant of transfer() used below currently only exists in the Adafruit
|
|
||||||
// core. It causes a build failure when building against the main Arduino SAMD
|
|
||||||
// core. Unfortunately there doesn't seem to be a supported #define that this
|
|
||||||
// code can use to tell which core it's building against. This hack (checking
|
|
||||||
// for the include guard that gets defined when the Adafruit core's SPI.h
|
|
||||||
// includes Adafruit_ZeroDMA.h) works for now, but it should be improved when
|
|
||||||
// possible.
|
|
||||||
if (_spi) {
|
|
||||||
if (prefix_len > 0) {
|
|
||||||
_spi->transfer(prefix_buffer, nullptr, prefix_len);
|
|
||||||
}
|
|
||||||
if (len > 0) {
|
|
||||||
_spi->transfer(buffer, nullptr, len);
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < prefix_len; i++) {
|
for (size_t i = 0; i < prefix_len; i++) {
|
||||||
|
|
@ -433,19 +417,6 @@ bool Adafruit_SPIDevice::write_then_read(uint8_t *write_buffer,
|
||||||
_spi->transferBytes(write_buffer, nullptr, write_len);
|
_spi->transferBytes(write_buffer, nullptr, write_len);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#elif defined(ARDUINO_ARCH_SAMD) && defined(_ADAFRUIT_ZERODMA_H_)
|
|
||||||
// The variant of transfer() used below currently only exists in the Adafruit
|
|
||||||
// core. It causes a build failure when building against the main Arduino SAMD
|
|
||||||
// core. Unfortunately there doesn't seem to be a supported #define that this
|
|
||||||
// code can use to tell which core it's building against. This hack (checking
|
|
||||||
// for the include guard that gets defined when the Adafruit core's SPI.h
|
|
||||||
// includes Adafruit_ZeroDMA.h) works for now, but it should be improved when
|
|
||||||
// possible.
|
|
||||||
if (_spi) {
|
|
||||||
if (write_len > 0) {
|
|
||||||
_spi->transfer(write_buffer, nullptr, write_len);
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < write_len; i++) {
|
for (size_t i = 0; i < write_len; i++) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue