1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sys/arduino: use static_assert() instead of BUILD_BUG_ON()

This commit is contained in:
Marian Buschsieweke 2021-11-25 09:46:45 +01:00
parent f022f88629
commit 674fca2023
No known key found for this signature in database
GPG Key ID: CB8E3238CE715A94

View File

@ -66,8 +66,10 @@ SPISettings::SPISettings(uint32_t clock_hz, uint8_t bitOrder, uint8_t dataMode)
SPIClass::SPIClass(spi_t spi_dev)
{
/* Check if default SPI interface is valid */
BUILD_BUG_ON(ARDUINO_SPI_INTERFACE >= SPI_NUMOF);
/* Check if default SPI interface is valid. Casting to int to avoid
* bogus type-limits warning here. */
static_assert((int)ARDUINO_SPI_INTERFACE <= (int)SPI_NUMOF,
"spi_dev out of bounds");
this->spi_dev = spi_dev;
this->settings = SPISettings();
this->is_transaction = false;