Skip to content

Commit

Permalink
link_layer/lwmac: use event queue for ISR offload
Browse files Browse the repository at this point in the history
  • Loading branch information
jia200x authored and benpicco committed May 10, 2022
1 parent 6040747 commit 869c5f3
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions sys/net/gnrc/link_layer/lwmac/lwmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <stdint.h>
#include <stdbool.h>

#include "event.h"
#include "od.h"
#include "timex.h"
#include "random.h"
Expand Down Expand Up @@ -796,14 +797,7 @@ static void _lwmac_event_cb(netdev_t *dev, netdev_event_t event)
gnrc_netif_t *netif = (gnrc_netif_t *) dev->context;

if (event == NETDEV_EVENT_ISR) {
msg_t msg;

msg.type = NETDEV_MSG_TYPE_EVENT;
msg.content.ptr = (void *) netif;

if (msg_send(&msg, netif->pid) <= 0) {
LOG_WARNING("WARNING: [LWMAC] gnrc_netdev: possibly lost interrupt.\n");
}
event_post(&netif->evq, &netif->event_isr);
}
else {
DEBUG("gnrc_netdev: event triggered -> %i\n", event);
Expand Down

0 comments on commit 869c5f3

Please sign in to comment.