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:
parent
f022f88629
commit
674fca2023
@ -66,8 +66,10 @@ SPISettings::SPISettings(uint32_t clock_hz, uint8_t bitOrder, uint8_t dataMode)
|
|||||||
|
|
||||||
SPIClass::SPIClass(spi_t spi_dev)
|
SPIClass::SPIClass(spi_t spi_dev)
|
||||||
{
|
{
|
||||||
/* Check if default SPI interface is valid */
|
/* Check if default SPI interface is valid. Casting to int to avoid
|
||||||
BUILD_BUG_ON(ARDUINO_SPI_INTERFACE >= SPI_NUMOF);
|
* 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->spi_dev = spi_dev;
|
||||||
this->settings = SPISettings();
|
this->settings = SPISettings();
|
||||||
this->is_transaction = false;
|
this->is_transaction = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user