Merge remote-tracking branch 'iotthinks/PowerSaving-v16' into keymindCascade

# Conflicts:
#	examples/simple_repeater/MyMesh.cpp
#	src/helpers/CommonCLI.cpp
#	src/helpers/CommonCLI.h
#	src/helpers/radiolib/RadioLibWrappers.cpp
This commit is contained in:
mikecarper committed 2026-07-06 15:27:14 -07:00
commit 84a4794282
12 files changed
+35 -43

No files matched your search

+2
View File
@@ -77,6 +77,8 @@ public:
virtual const char* getResetReasonString(uint32_t reason) { return "Not available"; }
virtual uint8_t getShutdownReason() const { return 0; }
virtual const char* getShutdownReasonString(uint8_t reason) { return "Not available"; }
inline static uint32_t n_cad_busy = 0;
};
/**
+1 -1
View File
@@ -1653,7 +1653,7 @@ void CommonCLI::handleGetCmd(uint32_t sender_timestamp, char* command, char* rep
} else if (memcmp(config, "int.thresh", 10) == 0) {
sprintf(reply, "> %d", (uint32_t) _prefs->interference_threshold);
} else if (memcmp(config, "cad", 3) == 0) {
sprintf(reply, "> %s", _prefs->cad_enabled ? "on" : "off");
sprintf(reply, "> %s. # channel busy: %u", _prefs->cad_enabled ? "on" : "off", _board->n_cad_busy);
} else if (memcmp(config, "agc.reset.interval", 18) == 0) {
sprintf(reply, "> %d", ((uint32_t) _prefs->agc_reset_interval) * 4);
} else if (memcmp(config, "multi.acks", 10) == 0) {
+1 -1
View File
@@ -89,7 +89,7 @@ void ESP32Board::enterDeepSleep(uint32_t secs) {
#ifdef P_LORA_NSS
// Keep LoRa inactive during deepsleep
digitalWrite(P_LORA_NSS, HIGH);
#if CONFIG_IDF_TARGET_ESP32C3
#if defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6)
gpio_hold_en((gpio_num_t)P_LORA_NSS);
#else
rtc_gpio_hold_en((gpio_num_t)P_LORA_NSS);
+6 -3
View File
@@ -69,8 +69,8 @@ void RadioLibWrapper::doResetAGC() {
}
void RadioLibWrapper::resetAGC() {
// make sure we're not mid-receive of packet!
if ((state & STATE_INT_READY) != 0 || isReceivingPacket()) return;
// make sure we're not mid-receiving and mid-sending of packet!
if ((state & STATE_INT_READY) != 0 || isReceivingPacket() || (state == STATE_TX_WAIT)) return;
doResetAGC();
state = STATE_IDLE; // trigger a startReceive()
@@ -195,7 +195,10 @@ bool RadioLibWrapper::isChannelActive() {
// try to read a non-existent packet and count a spurious recv error.
state = STATE_IDLE;
startRecv();
if (result != RADIOLIB_CHANNEL_FREE) return true;
if (result != RADIOLIB_CHANNEL_FREE) {
_board->n_cad_busy++;
return true;
}
}
return false;