Skip to content

Commit

Permalink
esp_now: fix unused variable warning
Browse files Browse the repository at this point in the history
esp_now_pkt_hdr_t *hdr is only used if gnrc_sixlowpan is used,
so move it into the according #ifdef

fixes #12257
  • Loading branch information
benpicco committed Sep 17, 2019
1 parent 1a89829 commit 9129ea7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cpu/esp_common/esp-now/esp_now_gnrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ static gnrc_pktsnip_t *_recv(gnrc_netif_t *netif)
pkt = mac_hdr;
goto err;
}
esp_now_pkt_hdr_t *hdr = (esp_now_pkt_hdr_t*)esp_hdr->data;

#ifdef MODULE_L2FILTER
if (!l2filter_pass(dev->filter, mac_hdr->data, ESP_NOW_ADDR_LEN)) {
Expand All @@ -160,6 +159,8 @@ static gnrc_pktsnip_t *_recv(gnrc_netif_t *netif)
pkt->type = GNRC_NETTYPE_UNDEF;

#ifdef MODULE_GNRC_SIXLOWPAN
esp_now_pkt_hdr_t *hdr = (esp_now_pkt_hdr_t*)esp_hdr->data;

if (hdr->flags & ESP_NOW_PKT_HDR_FLAG_SIXLO) {
pkt->type = GNRC_NETTYPE_SIXLOWPAN;
}
Expand Down

0 comments on commit 9129ea7

Please sign in to comment.