Reduce sender power draw (RX windows + CPU/WiFi/ADC/pins)
- Add LoRa idle/sleep/receive-window helpers and use short RX windows for ACK/time sync - Schedule sender time-sync windows (fast/slow) and track RX vs sleep time in debug - Lower sender power (80 MHz CPU, WiFi/BT off, reduced ADC sampling, unused pins pulldown) - Make SERIAL_DEBUG_MODE a build flag, add prod envs with debug off, and document changes
This commit is contained in:
@@ -110,10 +110,24 @@ bool lora_receive(LoraPacket &pkt, uint32_t timeout_ms) {
|
||||
}
|
||||
}
|
||||
|
||||
void lora_idle() {
|
||||
LoRa.idle();
|
||||
}
|
||||
|
||||
void lora_sleep() {
|
||||
LoRa.sleep();
|
||||
}
|
||||
|
||||
bool lora_receive_window(LoraPacket &pkt, uint32_t timeout_ms) {
|
||||
if (timeout_ms == 0) {
|
||||
return false;
|
||||
}
|
||||
LoRa.receive();
|
||||
bool got = lora_receive(pkt, timeout_ms);
|
||||
LoRa.sleep();
|
||||
return got;
|
||||
}
|
||||
|
||||
uint32_t lora_airtime_ms(size_t packet_len) {
|
||||
if (packet_len == 0) {
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user