mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
when doing AGC reset, call Calibrate(0x7F)
1. warm sleep 2. wake to stdby 3. Calibrate(0x7F) to reset all internal blocks 4. re-apply DIO2 RF / boosted gain & register patch to make sure everything is as it was
This commit is contained in:
parent
f81ec4b14c
commit
a2dc2eb50c
6 changed files with 114 additions and 5 deletions
|
|
@ -53,15 +53,15 @@ void RadioLibWrapper::triggerNoiseFloorCalibrate(int threshold) {
|
|||
}
|
||||
}
|
||||
|
||||
void RadioLibWrapper::doResetAGC() {
|
||||
_radio->sleep(); // warm sleep to reset analog frontend
|
||||
}
|
||||
|
||||
void RadioLibWrapper::resetAGC() {
|
||||
// make sure we're not mid-receive of packet!
|
||||
if ((state & STATE_INT_READY) != 0 || isReceivingPacket()) return;
|
||||
|
||||
// Warm sleep powers down the entire analog frontend (including AGC), forcing a
|
||||
// fresh gain calibration on the next startReceive(). A plain standby->startReceive
|
||||
// cycle does NOT reset the AGC — the analog state can persist across STDBY_RC.
|
||||
// The ~1-2 ms sleep gap is negligible vs the preamble budget (131 ms at SF11/BW250).
|
||||
_radio->sleep();
|
||||
doResetAGC();
|
||||
state = STATE_IDLE; // trigger a startReceive()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue