work needed for deep sleep Lora radio power measurements

This commit is contained in:
geeksville
2020-02-12 08:44:31 -08:00
parent d3ce56f1b5
commit c18306076a
3 changed files with 15 additions and 2 deletions

View File

@@ -104,6 +104,15 @@ void MeshRadio::reloadConfig()
DEBUG_MSG("Set radio: config=%u, ch=%d, txpower=%d\n", channelSettings.modem_config, channelSettings.channel_num, channelSettings.tx_power);
}
void MeshRadio::sleep() {
// we no longer care about interrupts from this device
rf95.prepareDeepSleep();
// FIXME - leave the device state in rx mode instead
rf95.sleep();
}
ErrorCode MeshRadio::send(MeshPacket *p)
{
DEBUG_MSG("enquing packet for send from=0x%x, to=0x%x\n", p->from, p->to);

View File

@@ -35,7 +35,7 @@ public:
bool init();
/// Prepare the radio to enter sleep mode, where it should draw only 0.2 uA
void sleep() { rf95.sleep(); }
void sleep();
/// Send a packet (possibly by enquing in a private fifo). This routine will
/// later free() the packet to pool. This routine is not allowed to stall because it is called from