Skip to content

Commit c5ee522

Browse files
author
Antti Kauppila
committed
Added flagging for DEVICE_SPI
1 parent ad7fc42 commit c5ee522

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

SX1272/SX1272_LoRaRadio.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,13 @@ SPDX-License-Identifier: BSD-3-Clause
2727
#include <math.h> //rint
2828
#include <string.h>
2929
#include "mbed.h"
30+
3031
#include "SX1272_LoRaRadio.h"
3132
#include "sx1272Regs-Fsk.h"
3233
#include "sx1272Regs-LoRa.h"
3334

35+
#ifdef DEVICE_SPI
36+
3437
#if defined(FEATURE_COMMON_PAL)
3538
#include "mbed_trace.h"
3639
#define TRACE_GROUP "LRAD"
@@ -55,6 +58,8 @@ SPDX-License-Identifier: BSD-3-Clause
5558
#define XTAL_FREQ 32000000
5659
#define FREQ_STEP 61.03515625
5760

61+
62+
5863
enum RadioVariant {
5964
SX1272MB2XAS = 0,
6065
SX1272MB1DCS
@@ -2165,3 +2170,6 @@ void SX1272_LoRaRadio::handle_timeout_irq()
21652170
break;
21662171
}
21672172
}
2173+
2174+
#endif //DEVICE_SPI
2175+

SX1272/SX1272_LoRaRadio.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,14 @@ SPDX-License-Identifier: BSD-3-Clause
3232
#include "DigitalInOut.h"
3333
#include "SPI.h"
3434
#include "Timeout.h"
35+
#include "platform/PlatformMutex.h"
3536
#ifdef MBED_CONF_RTOS_PRESENT
3637
#include "rtos/Thread.h"
3738
#endif
39+
3840
#include "lorawan/LoRaRadio.h"
3941

42+
#ifdef DEVICE_SPI
4043

4144
#ifdef MBED_CONF_SX1272_LORA_DRIVER_BUFFER_SIZE
4245
#define MAX_DATA_BUFFER_SIZE_SX172 MBED_CONF_SX1272_LORA_DRIVER_BUFFER_SIZE
@@ -416,4 +419,6 @@ class SX1272_LoRaRadio: public LoRaRadio {
416419
void handle_timeout_irq();
417420
};
418421

422+
#endif //DEVICE_SPI
423+
419424
#endif /* SX1272_LORARADIO_H_ */

SX1276/SX1276_LoRaRadio.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ SPDX-License-Identifier: BSD-3-Clause
3030
#include "sx1276Regs-Fsk.h"
3131
#include "sx1276Regs-LoRa.h"
3232

33+
#ifdef DEVICE_SPI
34+
3335
/*!
3436
* Sync word for Private LoRa networks
3537
*/
@@ -55,6 +57,7 @@ SPDX-License-Identifier: BSD-3-Clause
5557
#define RSSI_OFFSET_HF -157.0
5658
#define RF_MID_BAND_THRESH 525000000
5759

60+
5861
/*!
5962
* FSK bandwidth definition
6063
*/
@@ -2330,3 +2333,6 @@ void SX1276_LoRaRadio::handle_timeout_irq()
23302333
}
23312334
}
23322335
// EOF
2336+
2337+
#endif //DEVICE_SPI
2338+

SX1276/SX1276_LoRaRadio.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ SPDX-License-Identifier: BSD-3-Clause
3232
#include "DigitalInOut.h"
3333
#include "SPI.h"
3434
#include "Timeout.h"
35+
#include "platform/PlatformMutex.h"
3536
#ifdef MBED_CONF_RTOS_PRESENT
3637
#include "rtos/Thread.h"
3738
#endif
39+
3840
#include "lorawan/LoRaRadio.h"
3941

4042
#ifdef MBED_CONF_SX1276_LORA_DRIVER_BUFFER_SIZE
@@ -43,6 +45,8 @@ SPDX-License-Identifier: BSD-3-Clause
4345
#define MAX_DATA_BUFFER_SIZE_SX1276 256
4446
#endif
4547

48+
#ifdef DEVICE_SPI
49+
4650
/**
4751
* Radio driver implementation for Semtech SX1272 plus variants.
4852
* Supports only SPI at the moment. Implements pure virtual LoRaRadio class.
@@ -434,4 +438,6 @@ class SX1276_LoRaRadio: public LoRaRadio {
434438
void handle_timeout_irq();
435439
};
436440

441+
#endif //DEVICE_SPI
442+
437443
#endif // SX1276_LORARADIO_H_

0 commit comments

Comments
 (0)