From 0aa12b9f77399b04a0d388b32b7e43c0198a25ad Mon Sep 17 00:00:00 2001
From: Leandro Lanzieri <leandro.lanzieri@haw-hamburg.de>
Date: Wed, 17 Oct 2018 16:11:40 +0200
Subject: [PATCH] pkg/semtech-loramac: Reduce timeout in timer

---
 pkg/semtech-loramac/contrib/semtech_loramac_timer.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/pkg/semtech-loramac/contrib/semtech_loramac_timer.c b/pkg/semtech-loramac/contrib/semtech_loramac_timer.c
index 790aca24b4..59686b5645 100644
--- a/pkg/semtech-loramac/contrib/semtech_loramac_timer.c
+++ b/pkg/semtech-loramac/contrib/semtech_loramac_timer.c
@@ -62,9 +62,10 @@ void TimerSetValue(TimerEvent_t *obj, uint32_t value)
 
     /* According to the lorawan specifications, the data sent from the gateway
        could arrive with a short shift in time of +/- 20ms. Here the timeout is
-       triggered 22ms in advance to make sure the radio switches to RX mode on
-       time and doesn't miss any downlink messages. */
-    obj->timeout = (value - 22) * US_PER_MS;
+       triggered 50ms in advance to make sure the radio switches to RX mode on
+       time and doesn't miss any downlink messages, taking in consideration
+       possible xtimer inaccuracies. */
+    obj->timeout = (value - 50) * US_PER_MS;
 }
 
 TimerTime_t TimerGetCurrentTime(void)
-- 
GitLab