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

Merge pull request #13264 from gschorcht/sys/arduinu/fix_spi_ndebug_error

sys/arduino: fix of compilation error in with NDEBUG
This commit is contained in:
Marian Buschsieweke 2020-02-03 09:06:53 +01:00 committed by GitHub
commit 769209351a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,6 +28,8 @@ extern "C" {
SPISettings::SPISettings(uint32_t clock_hz, uint8_t bitOrder, uint8_t dataMode)
{
(void)bitOrder;
static const spi_clk_t clocks[] = {
SPI_CLK_10MHZ, SPI_CLK_5MHZ, SPI_CLK_1MHZ, SPI_CLK_400KHZ
};
@ -80,6 +82,9 @@ void SPIClass::beginTransaction(SPISettings settings)
settings.mode, settings.clock);
/* No support for exceptions (at least on AVR), resort to assert() */
assert(retval == SPI_OK);
if (retval != SPI_OK) {
return;
}
is_transaction = true;
}
@ -99,6 +104,9 @@ void SPIClass::transfer(void *buf, size_t count)
settings.mode, settings.clock);
/* No support for exceptions (at least on AVR), resort to assert() */
assert(retval == SPI_OK);
if (retval != SPI_OK) {
return;
}
}
spi_transfer_bytes(spi_dev, SPI_CS_UNDEF, false, buf, buf, count);
if (!is_transaction) {
@ -110,6 +118,7 @@ void SPIClass::transfer(void *buf, size_t count)
void SPIClass::setBitOrder(uint8_t order)
{
(void)order;
assert(order == MSBFIRST);
}