diff options
Diffstat (limited to 'libhw')
-rw-r--r-- | libhw/host_alarmclock.c | 2 | ||||
-rw-r--r-- | libhw/host_net.c | 4 | ||||
-rw-r--r-- | libhw/rp2040_hwspi.c | 7 | ||||
-rw-r--r-- | libhw/rp2040_hwtimer.c | 3 | ||||
-rw-r--r-- | libhw/w5500_ll.h | 4 |
5 files changed, 9 insertions, 11 deletions
diff --git a/libhw/host_alarmclock.c b/libhw/host_alarmclock.c index 141927c..4f43fc7 100644 --- a/libhw/host_alarmclock.c +++ b/libhw/host_alarmclock.c @@ -4,13 +4,13 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -#include <assert.h> #include <errno.h> #include <error.h> #include <signal.h> #include <time.h> #include <libcr/coroutine.h> +#include <libmisc/assert.h> #include <libmisc/vcall.h> #define IMPLEMENTATION_FOR_LIBHW_GENERIC_ALARMCLOCK_H YES diff --git a/libhw/host_net.c b/libhw/host_net.c index 88bda49..db31522 100644 --- a/libhw/host_net.c +++ b/libhw/host_net.c @@ -6,7 +6,6 @@ #define _GNU_SOURCE /* for pthread_sigqueue(3gnu) */ /* misc */ -#include <assert.h> /* for assert() */ #include <errno.h> /* for errno, EAGAIN, EINVAL */ #include <error.h> /* for error(3gnu) */ #include <stdlib.h> /* for abs(), shutdown(), SHUT_RD, SHUT_WR, SHUT_RDWR */ @@ -20,6 +19,7 @@ #include <signal.h> /* for siginfo_t, struct sigaction, enum sigval, sigaction(), SA_SIGINFO */ #include <libcr/coroutine.h> +#include <libmisc/assert.h> #include <libmisc/vcall.h> #include <libhw/generic/alarmclock.h> @@ -325,7 +325,7 @@ static int hostnet_tcp_close(implements_net_stream_conn *_conn, bool rd, bool wr else if (!rd && wr) how = SHUT_WR; else - assert(false); + assert_notreached("invalid arguments to stream_conn.close()"); return hostnet_map_negerrno(shutdown(conn->fd, how) ? -errno : 0); } 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); } diff --git a/libhw/rp2040_hwtimer.c b/libhw/rp2040_hwtimer.c index 54bdab3..69c2a50 100644 --- a/libhw/rp2040_hwtimer.c +++ b/libhw/rp2040_hwtimer.c @@ -4,12 +4,11 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -#include <assert.h> - #include <hardware/irq.h> /* pico-sdk:hardware_irq */ #include <hardware/timer.h> /* pico-sdk:hardware_timer */ #include <libcr/coroutine.h> +#include <libmisc/assert.h> #include <libmisc/vcall.h> #define IMPLEMENTATION_FOR_LIBHW_GENERIC_ALARMCLOCK_H YES diff --git a/libhw/w5500_ll.h b/libhw/w5500_ll.h index db66f01..1f578a9 100644 --- a/libhw/w5500_ll.h +++ b/libhw/w5500_ll.h @@ -10,12 +10,12 @@ #ifndef _LIBHW_W5500_LL_H_ #define _LIBHW_W5500_LL_H_ -#include <assert.h> /* for assert(), static_assert() */ #include <stdint.h> /* for uint{n}_t */ #include <string.h> /* for memcmp() */ -#include <libmisc/vcall.h> /* for VCALL() */ +#include <libmisc/assert.h> /* for assert(), static_assert() */ #include <libmisc/endian.h> /* for uint16be_t */ +#include <libmisc/vcall.h> /* for VCALL() */ #include <libhw/generic/net.h> /* for struct net_eth_addr, struct net_ip4_addr */ #include <libhw/generic/spi.h> /* for implements_spi */ |