diff options
Diffstat (limited to 'libhw/rp2040_hwspi.c')
-rw-r--r-- | libhw/rp2040_hwspi.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libhw/rp2040_hwspi.c b/libhw/rp2040_hwspi.c index 4edcdf7..da7ee78 100644 --- a/libhw/rp2040_hwspi.c +++ b/libhw/rp2040_hwspi.c @@ -4,11 +4,10 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -#include <assert.h> - #include <hardware/spi.h> /* pico-sdk:hardware_spi */ #include <hardware/gpio.h> /* pico-sdk:hardware_gpio */ +#include <libmisc/assert.h> #include <libmisc/vcall.h> #define IMPLEMENTATION_FOR_LIBHW_RP2040_HWSPI_H YES @@ -67,7 +66,7 @@ void _rp2040_hwspi_init(struct rp2040_hwspi *self, assert(pin_mosi == 11 || pin_mosi == 15 || pin_mosi == 27); break; default: - assert(false); + assert_notreached("invalid hwspi instance number"); } spi_init(inst, baudrate_hz); @@ -117,7 +116,7 @@ static void rp2040_hwspi_readwritev(implements_spi *_self, const struct bidi_iov else if (iov[i].iov_read_dst) spi_read_blocking(inst, 0, iov[i].iov_read_dst, iov[i].iov_len); else - assert(false); + assert_notreached("bidi_iovec is neither read nor write"); } gpio_put(self->pin_cs, 1); } |