Replace M0 state offset field with a byte count.

Instead of this count wrapping at the buffer size, it now increments
continuously. The offset within the buffer is now obtained from the
lower bits of the count.

This makes it possible to keep track of the total number of bytes
transferred by the M0 core.

The count will wrap at 2^32 bytes, which at 20Msps will occur every
107 seconds.
This commit is contained in:
Martin Ling
2021-12-22 02:29:41 +00:00
parent be060ab753
commit 21dabc920f
6 changed files with 27 additions and 24 deletions

View File

@@ -379,7 +379,7 @@ int write_register(hackrf_device* device, uint8_t part,
static void print_state(hackrf_m0_state *state) {
printf("M0 state:\n");
printf("Offset: %u bytes\n", state->offset);
printf("M0 count: %u bytes\n", state->m0_count);
printf("TX: %u\n", state->tx);
}