Driver library for SX1272/SX1276 transceivers

Fork of SX127x by wayne roberts

Revision:
6:5d94ee847016
Parent:
4:d987ac2836bf
Child:
7:c785b65d3db4
--- a/sx127x.cpp	Tue Jun 03 20:44:30 2014 +0000
+++ b/sx127x.cpp	Mon Jun 30 17:05:12 2014 +0000
@@ -204,6 +204,19 @@
 void SX127x::set_opmode(chip_mode_e mode)
 {
     RegOpMode.bits.Mode = mode;
+    
+    if (mode == RF_OPMODE_TRANSMITTER) {  // start of transmission
+        if (HF)
+            femctx = 1;
+        else
+            femcps = 0;
+    } else if (mode == RF_OPMODE_RECEIVER) { // start of reception
+        if (HF)
+            femctx = 0;
+        else
+            femcps = 1;    
+    }
+
     write_reg(REG_OPMODE, RegOpMode.octet);
 }