From c2e377dcf322420cdb724bb93a1a2ad4a1b90aba Mon Sep 17 00:00:00 2001 From: Koen Zandberg Date: Thu, 4 May 2023 18:25:16 +0200 Subject: [PATCH] pkg/openthread: set event callback before netdev init When using openthread with the ieee802154_submac module, a hard fault is triggered otherwise because the submac's init function calls the event_handler callback. --- pkg/openthread/contrib/netdev/openthread_netdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/openthread/contrib/netdev/openthread_netdev.c b/pkg/openthread/contrib/netdev/openthread_netdev.c index 8bb4270ca0..f3a8ef05fe 100644 --- a/pkg/openthread/contrib/netdev/openthread_netdev.c +++ b/pkg/openthread/contrib/netdev/openthread_netdev.c @@ -84,8 +84,8 @@ static void *_openthread_event_loop(void *arg) event_queue_init(&ev_queue); - netdev->driver->init(netdev); netdev->event_callback = _event_cb; + netdev->driver->init(netdev); netopt_enable_t enable = NETOPT_ENABLE; netdev->driver->set(netdev, NETOPT_TX_END_IRQ, &enable, sizeof(enable));