lf t55xx detect: save and restore the graph buffer through the shared helpers
The psk antenna-settle trim open-coded the save/restore pair: save_bufferS32 plus g_GridOffset on the way in, and restore_bufferS32's return assigned to g_GraphTraceLen on the way out. graph.c now has save_graphbuffer and restore_graphbuffer, which hold contents, length and grid offset together, so call those and drop the local copy of the length contract. No behaviour change. `lf t55xx detect -1` on the in-tree psk traces leaves the graph at 20000 samples before and after. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cec0e800ab
commit
e810245caa
1 file changed
+2
-5
@@ -111,8 +111,7 @@ static void t55xx_record_hit(t55xx_conf_block_t *t) {
|
||||
|
||||
// skip first 160 samples to allow antenna to settle in (psk gets inverted occasionally otherwise)
|
||||
static buffer_savestate_t t55xx_psk_trim_head(void) {
|
||||
buffer_savestate_t st = save_bufferS32(g_GraphBuffer, g_GraphTraceLen);
|
||||
st.offset = g_GridOffset;
|
||||
buffer_savestate_t st = save_graphbuffer();
|
||||
|
||||
char ltrim[16];
|
||||
snprintf(ltrim, sizeof(ltrim), "-i %d", T55XX_PSK_SETTLE_TRIM);
|
||||
@@ -124,9 +123,7 @@ static buffer_savestate_t t55xx_psk_trim_head(void) {
|
||||
|
||||
static void t55xx_psk_untrim_head(buffer_savestate_t st) {
|
||||
s_sample_bias = 0;
|
||||
// restore_bufferS32 returns the length it put back; dropping it leaves the trim in place
|
||||
g_GraphTraceLen = restore_bufferS32(st, g_GraphBuffer);
|
||||
g_GridOffset = st.offset;
|
||||
restore_graphbuffer(st);
|
||||
}
|
||||
|
||||
// the bit offset to read a block at in the demod buffer loaded right now
|
||||
|
||||
Reference in new issue
Block a user