From 6dfc07b0761abe685b6a935cc0b4a1fc87178394 Mon Sep 17 00:00:00 2001
From: Alexandre Abadie <alexandre.abadie@inria.fr>
Date: Mon, 2 Apr 2018 18:01:21 +0200
Subject: [PATCH] drivers/sx127x: remove useless rx timeout setter

---
 drivers/include/sx127x.h       | 4 ++--
 drivers/sx127x/sx127x_getset.c | 5 ++---
 drivers/sx127x/sx127x_netdev.c | 1 -
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/include/sx127x.h b/drivers/include/sx127x.h
index c7712be838..0d9f4f4be5 100644
--- a/drivers/include/sx127x.h
+++ b/drivers/include/sx127x.h
@@ -173,8 +173,8 @@ typedef struct {
     uint8_t coderate;                  /**< Error coding rate */
     uint8_t freq_hop_period;           /**< Frequency hop period */
     uint8_t flags;                     /**< Boolean flags */
-    uint32_t rx_timeout;               /**< RX timeout in symbols */
-    uint32_t tx_timeout;               /**< TX timeout in symbols */
+    uint32_t rx_timeout;               /**< RX timeout in microseconds */
+    uint32_t tx_timeout;               /**< TX timeout in microseconds */
 } sx127x_lora_settings_t;
 
 /**
diff --git a/drivers/sx127x/sx127x_getset.c b/drivers/sx127x/sx127x_getset.c
index 46a27bb67b..ec60723425 100644
--- a/drivers/sx127x/sx127x_getset.c
+++ b/drivers/sx127x/sx127x_getset.c
@@ -313,6 +313,7 @@ void sx127x_set_rx(sx127x_t *dev)
         xtimer_set(&(dev->_internal.rx_timeout_timer), dev->settings.lora.rx_timeout);
     }
 
+
     if (dev->settings.lora.flags & SX127X_RX_CONTINUOUS_FLAG) {
         sx127x_set_op_mode(dev, SX127X_RF_LORA_OPMODE_RECEIVER);
     }
@@ -830,13 +831,11 @@ void sx127x_set_symbol_timeout(sx127x_t *dev, uint16_t timeout)
 {
     DEBUG("[sx127x] Set symbol timeout: %d\n", timeout);
 
-    dev->settings.lora.rx_timeout = timeout;
-
     uint8_t config2_reg = sx127x_reg_read(dev, SX127X_REG_LR_MODEMCONFIG2);
     config2_reg &= SX127X_RF_LORA_MODEMCONFIG2_SYMBTIMEOUTMSB_MASK;
     config2_reg |= (timeout >> 8) & ~SX127X_RF_LORA_MODEMCONFIG2_SYMBTIMEOUTMSB_MASK;
     sx127x_reg_write(dev, SX127X_REG_LR_MODEMCONFIG2, config2_reg);
-    sx127x_reg_write(dev, SX127X_REG_LR_SYMBTIMEOUTLSB,timeout & 0xFF);
+    sx127x_reg_write(dev, SX127X_REG_LR_SYMBTIMEOUTLSB, timeout & 0xFF);
 }
 
 bool sx127x_get_iq_invert(const sx127x_t *dev)
diff --git a/drivers/sx127x/sx127x_netdev.c b/drivers/sx127x/sx127x_netdev.c
index 84d22c38b4..72b355c4c1 100644
--- a/drivers/sx127x/sx127x_netdev.c
+++ b/drivers/sx127x/sx127x_netdev.c
@@ -194,7 +194,6 @@ static int _recv(netdev_t *netdev, void *buf, size_t len, void *info)
             }
 
             xtimer_remove(&dev->_internal.rx_timeout_timer);
-
             /* Read the last packet from FIFO */
             uint8_t last_rx_addr = sx127x_reg_read(dev, SX127X_REG_LR_FIFORXCURRENTADDR);
             sx127x_reg_write(dev, SX127X_REG_LR_FIFOADDRPTR, last_rx_addr);
-- 
GitLab