Use the SX1262 receive duty cycle mode to get radio current draw down to

about 2.5mA @ 3V while in receive mode.
This commit is contained in:
geeksville
2020-05-24 19:23:50 -07:00
parent 48de631e04
commit 2770cc7de3
3 changed files with 19 additions and 6 deletions

View File

@@ -89,16 +89,25 @@ void SX1262Interface::addReceiveMetadata(MeshPacket *mp)
mp->rx_snr = lora.getSNR();
}
// For power draw measurements, helpful to force radio to stay sleeping
// #define SLEEP_ONLY
void SX1262Interface::startReceive()
{
#ifdef SLEEP_ONLY
sleep();
#else
setStandby();
int err = lora.startReceive();
// int err = lora.startReceive();
int err = lora.startReceiveDutyCycleAuto(); // We use a 32 bit preamble so this should save some power by letting radio sit in
// standby mostly.
assert(err == ERR_NONE);
isReceiving = true;
// Must be done AFTER, starting transmit, because startTransmit clears (possibly stale) interrupt pending register bits
enableInterrupt(isrRxLevel0);
#endif
}
/** Could we send right now (i.e. either not actively receving or transmitting)? */