From 39324874e186bec57156e9e8589756cfb507c54b Mon Sep 17 00:00:00 2001 From: Terry Moore Date: Fri, 29 Jun 2018 20:52:19 -0400 Subject: [PATCH] Fix #83: Make ttn-otaa-feather-us915 work with Catena4551 --- .../ttn-otaa-feather-us915.ino | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) 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 03639818..055aed88 100644 --- a/examples/ttn-otaa-feather-us915/ttn-otaa-feather-us915.ino +++ b/examples/ttn-otaa-feather-us915/ttn-otaa-feather-us915.ino @@ -65,12 +65,34 @@ static osjob_t sendjob; const unsigned TX_INTERVAL = 60; // Pin mapping +#if defined(ARDUINO_SAMD_FEATHER_M0) +// Pin mapping for Adafruit Feather M0 LoRa, etc. const lmic_pinmap lmic_pins = { .nss = 8, .rxtx = LMIC_UNUSED_PIN, .rst = 4, - .dio = { 3, 6, LMIC_UNUSED_PIN }, + .dio = {3, 6, LMIC_UNUSED_PIN}, + .rxtx_rx_active = 0, + .rssi_cal = 8, // LBT cal for the Adafruit Feather M0 LoRa, in dB + .spi_freq = 8000000, }; +#elif defined(ARDUINO_CATENA_4551) +// Pin mapping for Murata module / Catena 4551 +const lmic_pinmap lmic_pins = { + .nss = 7, + .rxtx = 29, + .rst = 8, + .dio = { 25, // DIO0 (IRQ) is D25 + 26, // DIO1 is D26 + 27, // DIO2 is D27 + }, + .rxtx_rx_active = 1, + .rssi_cal = 10, + .spi_freq = 8000000 // 8MHz +}; +#else +# error "Unknown target" +#endif void onEvent (ev_t ev) { Serial.print(os_getTime());