summaryrefslogtreecommitdiff
path: root/libhw
diff options
context:
space:
mode:
Diffstat (limited to 'libhw')
-rw-r--r--libhw/w5500.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libhw/w5500.c b/libhw/w5500.c
index c039226..563fd8b 100644
--- a/libhw/w5500.c
+++ b/libhw/w5500.c
@@ -331,11 +331,6 @@ void _w5500_init(struct w5500 *chip,
};
}
- /* 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);
- w5500_hard_reset(chip);
-
/* Validate that SPI works correctly. */
for (uint16_t a = 0; a < 0x100; a++) {
w5500ll_write_sock_reg(chip->spidev, 0, mode, a);
@@ -345,6 +340,11 @@ void _w5500_init(struct w5500 *chip,
}
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);
+ w5500_hard_reset(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++) {