summaryrefslogtreecommitdiff
path: root/libhw/w5500.c
diff options
context:
space:
mode:
Diffstat (limited to 'libhw/w5500.c')
-rw-r--r--libhw/w5500.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/libhw/w5500.c b/libhw/w5500.c
index f36b9cf..cebcf8e 100644
--- a/libhw/w5500.c
+++ b/libhw/w5500.c
@@ -105,9 +105,6 @@
/* C language *****************************************************************/
-#define UNUSED(name)
-#define ARRAY_LEN(ary) (sizeof(ary)/sizeof((ary)[0]))
-
static const char *w5500_state_str(uint8_t state) {
switch (state) {
case STATE_CLOSED: return "STATE_CLOSED";
@@ -328,9 +325,9 @@ static inline void w5500_socket_close(struct _w5500_socket *socket) {
static struct w5500 *w5500_chips[CONFIG_W5500_NUM] = {0};
-static void w5500_intrhandler(uint gpio, uint32_t UNUSED(event_mask)) {
+static void w5500_intrhandler(uint gpio, uint32_t LM_UNUSED(event_mask)) {
debugf("w5500_intrhandler(): interrupt on pin %u", gpio);
- for (size_t i = 0; i < ARRAY_LEN(w5500_chips); i++)
+ for (size_t i = 0; i < LM_ARRAY_LEN(w5500_chips); i++)
if (w5500_chips[i] && w5500_chips[i]->pin_intr == gpio)
cr_sema_signal_from_intrhandler(&w5500_chips[i]->intr);
}
@@ -374,7 +371,7 @@ void _w5500_init(struct w5500 *chip,
/* Finally, wire in the interrupt handler. */
bool saved = cr_save_and_disable_interrupts();
- for (size_t i = 0; i < ARRAY_LEN(w5500_chips); i++) {
+ for (size_t i = 0; i < LM_ARRAY_LEN(w5500_chips); i++) {
if (w5500_chips[i] == NULL) {
w5500_chips[i] = chip;
break;