From b2cde393140f6e03be8d141aac3af247b8b6fe4c Mon Sep 17 00:00:00 2001 From: Terry Moore Date: Mon, 20 May 2019 12:21:47 -0400 Subject: [PATCH] Fix #101: adapt better to Adafruit BSPs --- examples/raw-feather/raw-feather.ino | 6 +++++- examples/ttn-otaa-feather-us915/ttn-otaa-feather-us915.ino | 6 +++++- src/hal/getpinmap_thisboard.cpp | 6 +++++- src/lmic/lmic.h | 2 +- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/examples/raw-feather/raw-feather.ino b/examples/raw-feather/raw-feather.ino index cd24019c..3ffe7907 100644 --- a/examples/raw-feather/raw-feather.ino +++ b/examples/raw-feather/raw-feather.ino @@ -57,7 +57,11 @@ Author: #define RX_RSSI_INTERVAL 100 // milliseconds // Pin mapping for Adafruit Feather M0 LoRa, etc. -#if defined(ARDUINO_SAMD_FEATHER_M0) +// +// Adafruit BSPs are not consistent -- m0 express defs ARDUINO_SAMD_FEATHER_M0, +// m0 defs ADAFRUIT_FEATHER_M0 +// +#if defined(ARDUINO_SAMD_FEATHER_M0) || defined(ADAFRUIT_FEATHER_M0) const lmic_pinmap lmic_pins = { .nss = 8, .rxtx = LMIC_UNUSED_PIN, diff --git a/examples/ttn-otaa-feather-us915/ttn-otaa-feather-us915.ino b/examples/ttn-otaa-feather-us915/ttn-otaa-feather-us915.ino index cda7a636..1ee214ad 100644 --- a/examples/ttn-otaa-feather-us915/ttn-otaa-feather-us915.ino +++ b/examples/ttn-otaa-feather-us915/ttn-otaa-feather-us915.ino @@ -75,7 +75,11 @@ static osjob_t sendjob; const unsigned TX_INTERVAL = 60; // Pin mapping -#if defined(ARDUINO_SAMD_FEATHER_M0) +// +// Adafruit BSPs are not consistent -- m0 express defs ARDUINO_SAMD_FEATHER_M0, +// m0 defs ADAFRUIT_FEATHER_M0 +// +#if defined(ARDUINO_SAMD_FEATHER_M0) || defined(ADAFRUIT_FEATHER_M0) // Pin mapping for Adafruit Feather M0 LoRa, etc. const lmic_pinmap lmic_pins = { .nss = 8, diff --git a/src/hal/getpinmap_thisboard.cpp b/src/hal/getpinmap_thisboard.cpp index 4023c17e..bdfd3781 100644 --- a/src/hal/getpinmap_thisboard.cpp +++ b/src/hal/getpinmap_thisboard.cpp @@ -19,7 +19,11 @@ namespace Arduino_LMIC { const HalPinmap_t *GetPinmap_ThisBoard(void) { -#if defined(ARDUINO_SAMD_FEATHER_M0) +/* +|| Adafruit BSPs are not consistent -- m0 express defs ARDUINO_SAMD_FEATHER_M0, +|| m0 defs ADAFRUIT_FEATHER_M0 +*/ +#if defined(ARDUINO_SAMD_FEATHER_M0) || defined(ADAFRUIT_FEATHER_M0) # if defined(ARDUINO_MCCI_CATENA_4420) // this uses a radiowing and an odd configuration return GetPinmap_Catena4420(); diff --git a/src/lmic/lmic.h b/src/lmic/lmic.h index faa0799b..61c62f00 100644 --- a/src/lmic/lmic.h +++ b/src/lmic/lmic.h @@ -105,7 +105,7 @@ extern "C"{ #define ARDUINO_LMIC_VERSION_CALC(major, minor, patch, local) \ (((major) << 24u) | ((minor) << 16u) | ((patch) << 8u) | (local)) -#define ARDUINO_LMIC_VERSION ARDUINO_LMIC_VERSION_CALC(2, 3, 2, 50) /* v2.3.2.50 */ +#define ARDUINO_LMIC_VERSION ARDUINO_LMIC_VERSION_CALC(2, 3, 2, 51) /* v2.3.2.51 */ #define ARDUINO_LMIC_VERSION_GET_MAJOR(v) \ (((v) >> 24u) & 0xFFu)