mirror of
https://github.com/mikecarper/MeshCore.git
synced 2026-09-26 15:17:54 +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.
21 lines
1.1 KiB
C
21 lines
1.1 KiB
C
#pragma once
|
|
#include <stdint.h>
|
|
#include <stddef.h>
|
|
// HIL-only sub-float-resolution frequency detour. Never alters caller bytes.
|
|
static uint32_t hilFrequencyOffsetSteps=0;
|
|
struct HilFrequencyOffsetScope {
|
|
uint32_t previous;
|
|
explicit HilFrequencyOffsetScope(uint32_t steps):previous(hilFrequencyOffsetSteps) { hilFrequencyOffsetSteps=steps; }
|
|
~HilFrequencyOffsetScope() { hilFrequencyOffsetSteps=previous; }
|
|
HilFrequencyOffsetScope(const HilFrequencyOffsetScope&)=delete;
|
|
HilFrequencyOffsetScope& operator=(const HilFrequencyOffsetScope&)=delete;
|
|
};
|
|
inline const uint8_t* hilFrequencyCommand(const uint8_t* original,size_t len,uint8_t (&shifted)[5]) {
|
|
if(!original || len!=5 || original[0]!=0x86 || !hilFrequencyOffsetSteps) return original;
|
|
uint32_t word=uint32_t(original[1])<<24 | uint32_t(original[2])<<16 | uint32_t(original[3])<<8 | original[4];
|
|
if(word>UINT32_MAX-hilFrequencyOffsetSteps) return original; // per-hop verification fails closed
|
|
word+=hilFrequencyOffsetSteps;
|
|
shifted[0]=0x86;shifted[1]=word>>24;shifted[2]=word>>16;shifted[3]=word>>8;shifted[4]=word;
|
|
return shifted;
|
|
}
|