From b84cd6ac4ecacddf305c83412a5b1be1020478e2 Mon Sep 17 00:00:00 2001 From: Marcelo Aquino Date: Sat, 16 Jun 2018 14:19:32 -0300 Subject: [PATCH] Linux: Add rfm95 configure options (#1135) --- MyConfig.h | 1 + configure | 27 ++++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/MyConfig.h b/MyConfig.h index 8a4850393..5c2098725 100644 --- a/MyConfig.h +++ b/MyConfig.h @@ -602,6 +602,7 @@ * @def MY_RFM69_FREQUENCY * @brief The frequency to use. * + * - RFM69_315MHZ * - RFM69_433MHZ * - RFM69_868MHZ * - RFM69_915MHZ diff --git a/configure b/configure index b545e299c..ddf766658 100755 --- a/configure +++ b/configure @@ -85,7 +85,11 @@ MySensors options: Enables RFM69 encryption. All nodes and gateway must have this enabled, and all must be personalized with the same AES key. - --my-rfm95-encryption-enabled + --my-rfm95-frequency=[169|315|434|868|915] + RFM95 Module Frequency. [868] + --my-rfm95-irq-pin= Pin number connected to RFM95 IRQ pin. + --my-rfm95-cs-pin= Pin number to use for RFM95 Chip-Select. + --my-rfm95-encryption-enabled Enables RFM95 encryption. All nodes and gateway must have this enabled, and all must be personalized with the same AES key. @@ -454,6 +458,27 @@ for opt do encryption=true CPPFLAGS="-DMY_RFM69_ENABLE_ENCRYPTION $CPPFLAGS" ;; + --my-rfm95-frequency=*) + if [[ ${optarg} == "169" ]]; then + CPPFLAGS="-DMY_RFM95_FREQUENCY=RFM95_169MHZ $CPPFLAGS" + elif [[ ${optarg} == "315" ]]; then + CPPFLAGS="-DMY_RFM95_FREQUENCY=RFM95_315MHZ $CPPFLAGS" + elif [[ ${optarg} == "434" ]]; then + CPPFLAGS="-DMY_RFM95_FREQUENCY=RFM95_434MHZ $CPPFLAGS" + elif [[ ${optarg} == "868" ]]; then + CPPFLAGS="-DMY_RFM95_FREQUENCY=RFM95_868MHZ $CPPFLAGS" + elif [[ ${optarg} == "915" ]]; then + CPPFLAGS="-DMY_RFM95_FREQUENCY=RFM95_915MHZ $CPPFLAGS" + else + echo "[WARNING] Illegal value for --my-rfm95-frequency=${optarg}, ignored" + fi + ;; + --my-rfm95-irq-pin=*) + CPPFLAGS="-DMY_RFM95_IRQ_NUM=${optarg} $CPPFLAGS" + ;; + --my-rfm95-cs-pin=*) + CPPFLAGS="-DMY_RFM95_CS_PIN=${optarg} $CPPFLAGS" + ;; --my-rfm95-encryption-enabled*) encryption=true CPPFLAGS="-DMY_RFM95_ENABLE_ENCRYPTION $CPPFLAGS"