Better SubGHz ESP32-C6 Stability by doing housekeeping every 60 Seconds

This commit is contained in:
atc1441
2024-01-11 09:10:58 +01:00
parent 3b294be08a
commit 5abbead90b
4 changed files with 14 additions and 2 deletions

View File

@@ -790,6 +790,7 @@ void loop() {
}
}
radio_housekeeping();
memset(&lastTagReturn, 0, 8);
for (uint8_t cCount = 0; cCount < MAX_PENDING_MACS; cCount++) {
if (pendingDataArr[cCount].attemptsLeft == 1) {

View File

@@ -130,6 +130,16 @@ bool radioTx(uint8_t *packet, bool subGhz) {
}
}
void radio_housekeeping()
{
if (has_sub_ghz) {
tiRadioRxEnable(false, false);
delayMicroseconds(500);
tiRadioRxEnable(true, false);
delayMicroseconds(500);
}
}
void radioSetChannel(uint8_t ch) {
radio_init(ch);
}

View File

@@ -5,6 +5,7 @@
extern uint8_t mSelfMac[8];
void radio_init(uint8_t ch);
void radio_housekeeping();
bool radioTx(uint8_t *packet, bool subGhz);
void radioSetChannel(uint8_t ch);
void radioSetTxPower(uint8_t power);

View File

@@ -315,7 +315,7 @@ static void tiRadioPrvPacketRx(void) {
if (!now && !--nWaitCycles) {
tiRadioPrvDeselect();
ESP_LOGI(TAG, " !!! RX timeout !!! ");
ESP_LOGE(TAG, " !!! RX timeout !!! ");
goto fail;
}
@@ -408,7 +408,7 @@ out:
state = tiRadioPrvGetState();
if (!--maxWait) {
//ESP_LOGI(TAG, "too long wait for rx state. state is %d", state);
//ESP_LOGE(TAG, "too long wait for rx state. state is %d", state);
break;
}