1

Revision:
19:94b5382d3fc6
Parent:
17:5f34cbe2ac53
Child:
20:75635d50262e
diff -r 78c5e644d37a -r 94b5382d3fc6 radio_sx127x.cpp
--- a/radio_sx127x.cpp	Fri Jun 12 11:27:45 2020 -0700
+++ b/radio_sx127x.cpp	Thu Jun 25 12:39:08 2020 -0700
@@ -41,10 +41,17 @@
 
 void Radio::SetTxContinuousWave(unsigned hz, int8_t dbm, unsigned timeout_us)
 {
-    Radio::SetChannel(hz);
-    /* TODO: fsk enable, set regPacketConfig2.datamode */
+    fsk.enable(true);
+    fsk.RegPktConfig2.word = radio.read_u16(REG_FSK_PACKETCONFIG2);
+    fsk.RegPktConfig2.bits.DataModePacket = 0; // continuous mode
+    radio.write_u16(REG_FSK_PACKETCONFIG2, fsk.RegPktConfig2.word);
+    fsk.set_tx_fdev_hz(0);  // unmodulated carrier, aka dead carrier
+    SetChannel(hz);
     set_tx_dbm(dbm);
-    TxTimeoutEvent.attach_us(SX1272OnTimeoutIrq, timeout_us);
+
+    if (timeout_us != 0)
+        TxTimeoutEvent.attach_us(SX1272OnTimeoutIrq, timeout_us);
+
     radio.set_opmode(RF_OPMODE_TRANSMITTER);
 }