bladeRF-cli: Added "pretty print" of LMS reg readback to poke command

This commit is contained in:
Jon Szymaniak 2014-06-19 00:00:36 -04:00
commit a9d2e4cd4e
3 changed files with 11 additions and 1 deletions

View file

@ -111,7 +111,7 @@ set(BLADERF_CLI_SOURCE
src/cmd/load.c
src/cmd/open.c
src/cmd/peek.c
src/cmd/peek_lms_info.c
src/cmd/lms_reg_info.c
src/cmd/peekpoke.c
src/cmd/poke.c
src/cmd/printset.c

View file

@ -106,6 +106,16 @@ int cmd_poke(struct cli_state *state, int argc, char **argv)
rv = CLI_RET_LIBBLADERF;
} else {
printf( " 0x%2.2x: 0x%2.2x\n", address, value );
if (f == bladerf_lms_write) {
uint8_t readback;
int status = bladerf_lms_read(state->dev,
(uint8_t)address,
&readback);
if (status == 0) {
lms_reg_info(address, readback);
putchar('\n'); /* To be consistent with peek output */
}
}
}
}