Add a shortfall length limit.

This limit allows implementing a timeout: if a TX underrun or RX overrun
continues for the specified number of bytes, the M0 will revert to idle.

A setting of zero disables the limit.

This change adds 5 cycles to the TX & RX shortfall paths, to check if a
limit is set and to check the shortfall length against the limit.
This commit is contained in:
Martin Ling
2021-12-24 09:47:27 +00:00
parent 2c86f493d9
commit f0bc6eda30
4 changed files with 21 additions and 4 deletions

View File

@@ -390,6 +390,7 @@ static void print_state(hackrf_m0_state *state) {
printf("M4 count: %u bytes\n", state->m4_count);
printf("Number of shortfalls: %u\n", state->num_shortfalls);
printf("Longest shortfall: %u bytes\n", state->longest_shortfall);
printf("Shortfall limit: %u bytes\n", state->shortfall_limit);
}
static void usage() {