import struct

DUMP = r"C:/Users/vikto/Documents/Claude/rt-4d/radio-spi-dump.bin"
with open(DUMP, "rb") as f:
    cal = f.read(0x1000)

MARK = bytes.fromhex("12e234402a4fb3")
# find all marker positions
positions = []
i = 0
while True:
    j = cal.find(MARK, i)
    if j < 0: break
    positions.append(j)
    i = j+1
print("marker positions (hex):", [hex(p) for p in positions])
print("count:", len(positions))
# deltas
deltas = [positions[k+1]-positions[k] for k in range(len(positions)-1)]
print("deltas:", deltas)
print("unique deltas:", sorted(set(deltas)))

# The marker appears TWICE back to back (7+7=14 bytes). So real record period is bigger.
# Let's look at where non-duplicate markers are. Marker at 0x24 and 0x2b (0x24+7). So pairs.
