File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 20
20
#include < hal/hal.h>
21
21
#include < SPI.h>
22
22
23
+ #if !defined(DISABLE_INVERT_IQ_ON_RX)
24
+ #error This example requires DISABLE_INVERT_IQ_ON_RX to be set. Update \
25
+ config.h in the lmic library to set it.
26
+ #endif
27
+
23
28
lmic_pinmap pins = {
24
29
.nss = SS,
25
30
.rxtx = 8 , // Not connected
Original file line number Diff line number Diff line change 39
39
//#define DISABLE_MCMD_PING_SET // set ping freq, automatically disabled by DISABLE_PING
40
40
//#define DISABLE_MCMD_BCNI_ANS // next beacon start, automatical disabled by DISABLE_BEACON
41
41
42
+ // In LoRaWAN, a gateway applies I/Q inversion on TX, and nodes do the
43
+ // same on RX. This ensures that gateways can talk to nodes and vice
44
+ // versa, but gateways will not hear other gateways and nodes will not
45
+ // hear other nodes. By uncommenting this macro, this inversion is
46
+ // disabled and this node can hear other nodes. If two nodes both have
47
+ // this macro set, they can talk to each other (but they can no longer
48
+ // hear gateways). This should probably only be used when debugging
49
+ // and/or when talking to the radio directly (e.g. like in the "raw"
50
+ // example).
51
+ #define DISABLE_INVERT_IQ_ON_RX
42
52
#endif // _lmic_config_h_
Original file line number Diff line number Diff line change @@ -547,8 +547,10 @@ static void rxlora (u1_t rxmode) {
547
547
writeReg (RegLna , LNA_RX_GAIN );
548
548
// set max payload size
549
549
writeReg (LORARegPayloadMaxLength , 64 );
550
+ #if !defined(DISABLE_INVERT_IQ_ON_RX )
550
551
// use inverted I/Q signal (prevent mote-to-mote communication)
551
552
writeReg (LORARegInvertIQ , readReg (LORARegInvertIQ )|(1 <<6 ));
553
+ #endif
552
554
// set symbol timeout (for single rx)
553
555
writeReg (LORARegSymbTimeoutLsb , LMIC .rxsyms );
554
556
// set sync word
You can’t perform that action at this time.
0 commit comments