You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ut...@apache.org on 2020/01/09 09:38:11 UTC

[mynewt-core] 01/04: lora: allow SX127x connected to any SPI port

This is an automated email from the ASF dual-hosted git repository.

utzig pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 4e3038fb3eb2c8beafba14bb1728cf07c1a74658
Author: Fabio Utzig <ut...@apache.org>
AuthorDate: Wed Jan 8 09:25:50 2020 -0300

    lora: allow SX127x connected to any SPI port
    
    This removes a requirement that forces SPI index to always be zero.
    
    Signed-off-by: Fabio Utzig <ut...@apache.org>
---
 hw/drivers/lora/sx1272/src/sx1272-board.h | 3 ---
 hw/drivers/lora/sx1276/src/sx1276-board.h | 5 -----
 2 files changed, 8 deletions(-)

diff --git a/hw/drivers/lora/sx1272/src/sx1272-board.h b/hw/drivers/lora/sx1272/src/sx1272-board.h
index e8e9b11..27153bd 100644
--- a/hw/drivers/lora/sx1272/src/sx1272-board.h
+++ b/hw/drivers/lora/sx1272/src/sx1272-board.h
@@ -16,9 +16,6 @@ Maintainer: Miguel Luis and Gregory Cristian
 #define __SX1272_ARCH_H__
 
 #define RADIO_SPI_IDX           MYNEWT_VAL(SX1272_SPI_IDX)
-#if RADIO_SPI_IDX != 0
-#error "Invalid SX1272_SPI_IDX value. Must be zero"
-#endif
 
 #if MYNEWT_VAL(SX1272_SPI_CS_PIN) == -1
 #error "Must set SX1272_SPI_CS_PIN pin (spi slave select)"
diff --git a/hw/drivers/lora/sx1276/src/sx1276-board.h b/hw/drivers/lora/sx1276/src/sx1276-board.h
index 73edf9c..0e67531 100644
--- a/hw/drivers/lora/sx1276/src/sx1276-board.h
+++ b/hw/drivers/lora/sx1276/src/sx1276-board.h
@@ -18,12 +18,7 @@ Maintainer: Miguel Luis and Gregory Cristian
 #include "hal/hal_gpio.h"
 
 #define RADIO_SPI_IDX               MYNEWT_VAL(SX1276_SPI_IDX)
-
-#if RADIO_SPI_IDX == 0
 #define RADIO_NSS                   MYNEWT_VAL(SX1276_SPI_CS_PIN)
-#else
-#error Invalid SX1276_SPI_IDX value
-#endif
 
 /*!
  * \brief Radio hardware registers initialization definition