Skip to content

Commit b84cd6a

Browse files
marceloaqnofallberg
authored andcommitted
Linux: Add rfm95 configure options (#1135)
1 parent 88a0d70 commit b84cd6a

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

MyConfig.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@
602602
* @def MY_RFM69_FREQUENCY
603603
* @brief The frequency to use.
604604
*
605+
* - RFM69_315MHZ
605606
* - RFM69_433MHZ
606607
* - RFM69_868MHZ
607608
* - RFM69_915MHZ

configure

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ MySensors options:
8585
Enables RFM69 encryption.
8686
All nodes and gateway must have this enabled, and all must be
8787
personalized with the same AES key.
88-
--my-rfm95-encryption-enabled
88+
--my-rfm95-frequency=[169|315|434|868|915]
89+
RFM95 Module Frequency. [868]
90+
--my-rfm95-irq-pin=<PIN> Pin number connected to RFM95 IRQ pin.
91+
--my-rfm95-cs-pin=<PIN> Pin number to use for RFM95 Chip-Select.
92+
--my-rfm95-encryption-enabled
8993
Enables RFM95 encryption.
9094
All nodes and gateway must have this enabled, and all must be
9195
personalized with the same AES key.
@@ -454,6 +458,27 @@ for opt do
454458
encryption=true
455459
CPPFLAGS="-DMY_RFM69_ENABLE_ENCRYPTION $CPPFLAGS"
456460
;;
461+
--my-rfm95-frequency=*)
462+
if [[ ${optarg} == "169" ]]; then
463+
CPPFLAGS="-DMY_RFM95_FREQUENCY=RFM95_169MHZ $CPPFLAGS"
464+
elif [[ ${optarg} == "315" ]]; then
465+
CPPFLAGS="-DMY_RFM95_FREQUENCY=RFM95_315MHZ $CPPFLAGS"
466+
elif [[ ${optarg} == "434" ]]; then
467+
CPPFLAGS="-DMY_RFM95_FREQUENCY=RFM95_434MHZ $CPPFLAGS"
468+
elif [[ ${optarg} == "868" ]]; then
469+
CPPFLAGS="-DMY_RFM95_FREQUENCY=RFM95_868MHZ $CPPFLAGS"
470+
elif [[ ${optarg} == "915" ]]; then
471+
CPPFLAGS="-DMY_RFM95_FREQUENCY=RFM95_915MHZ $CPPFLAGS"
472+
else
473+
echo "[WARNING] Illegal value for --my-rfm95-frequency=${optarg}, ignored"
474+
fi
475+
;;
476+
--my-rfm95-irq-pin=*)
477+
CPPFLAGS="-DMY_RFM95_IRQ_NUM=${optarg} $CPPFLAGS"
478+
;;
479+
--my-rfm95-cs-pin=*)
480+
CPPFLAGS="-DMY_RFM95_CS_PIN=${optarg} $CPPFLAGS"
481+
;;
457482
--my-rfm95-encryption-enabled*)
458483
encryption=true
459484
CPPFLAGS="-DMY_RFM95_ENABLE_ENCRYPTION $CPPFLAGS"

0 commit comments

Comments
 (0)