Replace TX flag with a mode setting.

This is to let us start adding new operatin modes for the M0.
This commit is contained in:
Martin Ling
2021-12-24 07:44:18 +00:00
parent c0d0cd2a1d
commit 5b50b2dfac
5 changed files with 31 additions and 17 deletions

View File

@@ -378,10 +378,16 @@ int write_register(hackrf_device* device, uint8_t part,
}
static void print_state(hackrf_m0_state *state) {
const char *mode_names[] = {"RX", "TX"};
const uint32_t num_modes = sizeof(mode_names) / sizeof(mode_names[0]);
printf("M0 state:\n");
printf("Mode: %u (%s)\n",
state->mode,
state->mode < num_modes ?
mode_names[state->mode] :
"UNKNOWN");
printf("M0 count: %u bytes\n", state->m0_count);
printf("M4 count: %u bytes\n", state->m4_count);
printf("TX: %u\n", state->tx);
}
static void usage() {