Compare commits

..

11 Commits

Author SHA1 Message Date
Jonathan Bennett
577499f126 Use Throttle function 2026-02-01 22:53:34 -06:00
Jonathan Bennett
09eac5e692 Update src/main.cpp
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-01 22:38:44 -06:00
Jonathan Bennett
e9c551a419 AGC reset don't crash, don't naively call 2026-02-01 22:20:00 -06:00
Jonathan Bennett
39bac0db01 Merge branch 'develop' into agc-reset 2026-02-01 21:27:22 -06:00
Jonathan Bennett
e7306448be Trunk 2026-02-01 16:19:00 -06:00
Jonathan Bennett
51f9e537de Add radioLibInterface include 2026-02-01 16:01:23 -06:00
Jonathan Bennett
715918d5ac Merge branch 'develop' into agc-reset 2026-02-01 14:26:05 -06:00
Jonathan Bennett
a0e2b06970 Merge branch 'develop' into agc-reset 2026-01-28 16:17:28 -06:00
Jonathan Bennett
bc702b18d8 Merge branch 'develop' into agc-reset 2025-12-17 19:54:07 -06:00
Jonathan Bennett
5e2d8eac6a Merge branch 'develop' into agc-reset 2025-10-14 09:04:28 -05:00
Jonathan Bennett
971543fab3 Add agc reset attempt 2025-09-29 12:11:48 -05:00
3 changed files with 12 additions and 0 deletions

View File

@@ -7,6 +7,7 @@
#include "NodeDB.h"
#include "PowerFSM.h"
#include "PowerMon.h"
#include "RadioLibInterface.h"
#include "ReliableRouter.h"
#include "airtime.h"
#include "buzz.h"
@@ -193,6 +194,8 @@ bool kb_found = false;
// global bool to record that on-screen keyboard (OSK) is present
bool osk_found = false;
unsigned long last_listen = 0;
// The I2C address of the RTC Module (if found)
ScanI2C::DeviceAddress rtc_found = ScanI2C::ADDRESS_NONE;
// The I2C address of the Accelerometer (if found)
@@ -1166,6 +1169,12 @@ void loop()
#endif
power->powerCommandsCheck();
if (RadioLibInterface::instance != nullptr && !Throttle::isWithinTimespanMs(last_listen, 1000 * 60) &&
!(RadioLibInterface::instance->isSending() || RadioLibInterface::instance->isActivelyReceiving())) {
RadioLibInterface::instance->startReceive();
LOG_DEBUG("attempting AGC reset");
}
#ifdef DEBUG_STACK
static uint32_t lastPrint = 0;
if (!Throttle::isWithinTimespanMs(lastPrint, 10 * 1000L)) {

View File

@@ -33,6 +33,7 @@ extern ScanI2C::DeviceAddress cardkb_found;
extern uint8_t kb_model;
extern bool kb_found;
extern bool osk_found;
extern unsigned long last_listen;
extern ScanI2C::DeviceAddress rtc_found;
extern ScanI2C::DeviceAddress accelerometer_found;
extern ScanI2C::FoundDevice rgb_found;

View File

@@ -514,6 +514,8 @@ void RadioLibInterface::handleReceiveInterrupt()
void RadioLibInterface::startReceive()
{
// Note the updated timestamp, to avoid unneeded AGC resets
last_listen = millis();
isReceiving = true;
powerMon->setState(meshtastic_PowerMon_State_Lora_RXOn);
}