123

Revision:
7:927a05f84ede
Parent:
4:d987ac2836bf
Child:
10:7382c260c4b1
diff -r dde68100518b -r 927a05f84ede sx127x.cpp
--- a/sx127x.cpp	Tue Jun 03 20:44:30 2014 +0000
+++ b/sx127x.cpp	Mon Feb 09 23:26:05 2015 +0000
@@ -16,8 +16,8 @@
  * limitations under the License.
  */
 
-SX127x::SX127x(PinName mosi, PinName miso, PinName sclk, PinName cs, PinName rst, PinName dio_0, PinName dio_1, PinName fem_ctx, PinName fem_cps) :
-                m_spi(mosi, miso, sclk),                  m_cs(cs), reset_pin(rst), dio0(dio_0), dio1(dio_1), femctx(fem_ctx), femcps(fem_cps)
+SX127x::SX127x(PinName mosi, PinName miso, PinName sclk, PinName cs, PinName rst, PinName dio_0, PinName dio_1) :
+                m_spi(mosi, miso, sclk),                  m_cs(cs), reset_pin(rst), dio0(dio_0), dio1(dio_1)
 {
     reset_pin.input();
     m_cs = 1;
@@ -204,6 +204,10 @@
 void SX127x::set_opmode(chip_mode_e mode)
 {
     RegOpMode.bits.Mode = mode;
+    
+    // callback to control antenna switch and PaSelect (PABOOST/RFO) for TX
+    rf_switch.call();
+    
     write_reg(REG_OPMODE, RegOpMode.octet);
 }