[riot-notifications] [RIOT-OS/RIOT] drivers/kw2xrf: Use TMR3 instead TMR4 to detect ACK timeout (#12287)

benpicco notifications at github.com
Fri Sep 27 20:26:14 CEST 2019


benpicco commented on this pull request.



> -        kw2xrf_seq_timeout_off(dev);
-        kw2xrf_set_idle_sequence(dev);
-    }
-    else if (dregs[MKW2XDM_IRQSTS3] & MKW2XDM_IRQSTS3_TMR4IRQ) {
-        DEBUG("[kw2xrf] TC4TMOUT, no SEQIRQ, TX failed\n");
-        assert(dev->pending_tx != 0);
-        dev->pending_tx--;
-        netdev->event_callback(netdev, NETDEV_EVENT_TX_NOACK);
-        kw2xrf_seq_timeout_off(dev);
-        kw2xrf_set_sequence(dev, dev->idle_state);
+        if (dregs[MKW2XDM_IRQSTS3] & MKW2XDM_IRQSTS3_TMR3IRQ) {
+            /* if the sequence was aborted by timer 3, ACK timed out */
+            DEBUG("[kw2xrf] TC3TMOUT, SEQIRQ, TX failed\n");
+            irqsts1 |= MKW2XDM_IRQSTS1_SEQIRQ;
+            assert(dev->pending_tx != 0);
+            dev->pending_tx--;

The above three lines are common in both cases, you can put them before the `if`.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/12287#pullrequestreview-294492465
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190927/038f8e78/attachment.htm>


More information about the notifications mailing list