mirror of
https://github.com/mikecarper/MeshCore.git
synced 2026-09-25 08:03:36 +00:00
Skip redundant modulation writes during owned fast RX retunes when the last acknowledged SF/BW/CR/LDRO tuple matches. Invalidate that cache after ordinary setters, failed writes, and lifecycle changes. Include the remaining scan, preamble, settling, and memory-soak experiments, their collectors, validation notes, and original capture records. Preserve capture bytes across checkouts and keep private soak credentials local. Run lab collector and compiled contract tests in CI. Update the expectation, profile mapping, and result-buffer tests for the extended lab tools, and make the private WiFi override header optional for ordinary soak diagnostics. Validation: 145 host tests passed from the staged source snapshot. Clean heltec_v4_repeater and Xiao_S3_WIO_companion_radio_usb builds passed their RAM/flash gates. All 229 staged capture files retain their original bytes; all 75 local documentation links resolve in the clean snapshot.
29 lines
898 B
C
29 lines
898 B
C
#pragma once
|
|
#include <stdint.h>
|
|
|
|
// Lab scheduling only: RX is already active during post-BUSY settling.
|
|
struct ChannelVisitClock {
|
|
uint32_t rxStamp=0, listenAt=0;
|
|
void begin(uint32_t rxStarted,uint32_t settledAt,bool delayEnabled) {
|
|
rxStamp=rxStarted;listenAt=delayEnabled?settledAt:rxStarted;
|
|
}
|
|
uint32_t dwell(uint32_t now,uint32_t rxStarted) {
|
|
// Receiving/processing a packet restarts ordinary RX, not a channel hop.
|
|
if(rxStarted!=rxStamp) { rxStamp=rxStarted;listenAt=rxStarted; }
|
|
return uint32_t(now-listenAt);
|
|
}
|
|
};
|
|
|
|
struct ChannelCycleClock {
|
|
bool started=false, clean=false;
|
|
uint32_t origin=0;
|
|
bool hop(unsigned next,uint32_t now,bool held,uint32_t& elapsed) {
|
|
if(held) clean=false;
|
|
if(next!=0) return false;
|
|
const bool sample=started && clean;
|
|
elapsed=uint32_t(now-origin);
|
|
started=true;clean=true;origin=now;
|
|
return sample;
|
|
}
|
|
};
|