summaryrefslogtreecommitdiff
path: root/libhw/w5500.c
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-12-08 22:46:57 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-12-09 12:24:43 -0700
commit063f263f84d517c6497e7ca37f503956bad7075a (patch)
treef064dde7566f28300f1b0252b2b74337802ef9a1 /libhw/w5500.c
parent150a10e8841f012645b77d1a6eb10d25dbf89b56 (diff)
w5500: Debug logging
Diffstat (limited to 'libhw/w5500.c')
-rw-r--r--libhw/w5500.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/libhw/w5500.c b/libhw/w5500.c
index e675ae9..7a5ba01 100644
--- a/libhw/w5500.c
+++ b/libhw/w5500.c
@@ -239,6 +239,7 @@ static COROUTINE w5500_irq_cr(void *_chip) {
struct _w5500_socket *socket = &chip->sockets[socknum];
uint8_t sockintr = w5500ll_read_sock_reg(chip->spidev, socknum, interrupt);
+ debugf("w5500_irq_cr(): sockintr=%"PRIu8, sockintr);
switch (socket->mode) {
case W5500_MODE_NONE:
@@ -363,15 +364,6 @@ void _w5500_init(struct w5500 *chip,
};
}
- /* Validate that SPI works correctly. */
- for (uint16_t a = 0; a < 0x100; a++) {
- w5500ll_write_sock_reg(chip->spidev, 0, mode, a);
- uint8_t b = w5500ll_read_sock_reg(chip->spidev, 0, mode);
- if (b != a)
- errorf("SPI to W5500 does not appear to be functional: wrote:%d != read:%d", a, b);
- }
- w5500ll_write_sock_reg(chip->spidev, 0, mode, 0);
-
/* Initialize the hardware. */
gpio_set_irq_enabled_with_callback(pin_intr, GPIO_IRQ_EDGE_FALL, true, w5500_intrhandler);
gpio_set_dir(chip->pin_reset, GPIO_OUT);