Updated #if #elif structure.

Update #if #elif structure to avoid nested #ifdef's
This commit is contained in:
howard-wa9axq 2020-11-28 18:22:48 -06:00 committed by GitHub
parent 02b702fc41
commit b8e11f14f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -113,17 +113,16 @@ void Adafruit_SPIDevice::transfer(uint8_t *buffer, size_t len) {
if (_spi) { if (_spi) {
// hardware SPI is easy // hardware SPI is easy
#ifdef SPARK #if defined(SPARK)
_spi->transfer(buffer, buffer, len, NULL); _spi->transfer(buffer, buffer, len, NULL);
#else #elif defined(STM32)
#ifdef STM32
for (size_t i = 0; i < len; i++) { for (size_t i = 0; i < len; i++) {
_spi->transfer(buffer[i]); _spi->transfer(buffer[i]);
} }
#else #else
_spi->transfer(buffer, len); _spi->transfer(buffer, len);
#endif #endif
#endif
return; return;
} }