mirror of
https://github.com/meshtastic/firmware.git
synced 2026-02-04 08:02:00 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
577499f126 | ||
|
|
09eac5e692 | ||
|
|
e9c551a419 | ||
|
|
39bac0db01 | ||
|
|
e7306448be | ||
|
|
51f9e537de | ||
|
|
715918d5ac | ||
|
|
a0e2b06970 | ||
|
|
bc702b18d8 | ||
|
|
5e2d8eac6a | ||
|
|
971543fab3 |
@@ -7,6 +7,7 @@
|
|||||||
#include "NodeDB.h"
|
#include "NodeDB.h"
|
||||||
#include "PowerFSM.h"
|
#include "PowerFSM.h"
|
||||||
#include "PowerMon.h"
|
#include "PowerMon.h"
|
||||||
|
#include "RadioLibInterface.h"
|
||||||
#include "ReliableRouter.h"
|
#include "ReliableRouter.h"
|
||||||
#include "airtime.h"
|
#include "airtime.h"
|
||||||
#include "buzz.h"
|
#include "buzz.h"
|
||||||
@@ -193,6 +194,8 @@ bool kb_found = false;
|
|||||||
// global bool to record that on-screen keyboard (OSK) is present
|
// global bool to record that on-screen keyboard (OSK) is present
|
||||||
bool osk_found = false;
|
bool osk_found = false;
|
||||||
|
|
||||||
|
unsigned long last_listen = 0;
|
||||||
|
|
||||||
// The I2C address of the RTC Module (if found)
|
// The I2C address of the RTC Module (if found)
|
||||||
ScanI2C::DeviceAddress rtc_found = ScanI2C::ADDRESS_NONE;
|
ScanI2C::DeviceAddress rtc_found = ScanI2C::ADDRESS_NONE;
|
||||||
// The I2C address of the Accelerometer (if found)
|
// The I2C address of the Accelerometer (if found)
|
||||||
@@ -1166,6 +1169,12 @@ void loop()
|
|||||||
#endif
|
#endif
|
||||||
power->powerCommandsCheck();
|
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
|
#ifdef DEBUG_STACK
|
||||||
static uint32_t lastPrint = 0;
|
static uint32_t lastPrint = 0;
|
||||||
if (!Throttle::isWithinTimespanMs(lastPrint, 10 * 1000L)) {
|
if (!Throttle::isWithinTimespanMs(lastPrint, 10 * 1000L)) {
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ extern ScanI2C::DeviceAddress cardkb_found;
|
|||||||
extern uint8_t kb_model;
|
extern uint8_t kb_model;
|
||||||
extern bool kb_found;
|
extern bool kb_found;
|
||||||
extern bool osk_found;
|
extern bool osk_found;
|
||||||
|
extern unsigned long last_listen;
|
||||||
extern ScanI2C::DeviceAddress rtc_found;
|
extern ScanI2C::DeviceAddress rtc_found;
|
||||||
extern ScanI2C::DeviceAddress accelerometer_found;
|
extern ScanI2C::DeviceAddress accelerometer_found;
|
||||||
extern ScanI2C::FoundDevice rgb_found;
|
extern ScanI2C::FoundDevice rgb_found;
|
||||||
|
|||||||
@@ -514,6 +514,8 @@ void RadioLibInterface::handleReceiveInterrupt()
|
|||||||
|
|
||||||
void RadioLibInterface::startReceive()
|
void RadioLibInterface::startReceive()
|
||||||
{
|
{
|
||||||
|
// Note the updated timestamp, to avoid unneeded AGC resets
|
||||||
|
last_listen = millis();
|
||||||
isReceiving = true;
|
isReceiving = true;
|
||||||
powerMon->setState(meshtastic_PowerMon_State_Lora_RXOn);
|
powerMon->setState(meshtastic_PowerMon_State_Lora_RXOn);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user