jtagonizer

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit e704bd15b9cd273a756f6534f2274a208de3e6dc
parent e3e49547bb4f91e812b504a52036f96d50bd607b
Author: Brian Swetland <swetland@frotz.net>
Date:   Sun,  5 Oct 2014 23:08:19 -0700

jtag-core: make enumeration less chatty

Provide jtag_print_chain() if you really want to make noise.

Diffstat:
Mjtag-core.c | 12+++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/jtag-core.c b/jtag-core.c @@ -346,7 +346,6 @@ int jtag_enumerate(JTAG *jtag) { return -1; } for (n = 0; n < DEVMAX; n++) { - if (data[n] == 0xffffffff) { if (n == 0) { fprintf(stderr, "no devices found\n"); @@ -365,13 +364,20 @@ int jtag_enumerate(JTAG *jtag) { return -1; } memcpy(jtag->devinfo + n, info, sizeof(JTAG_INFO)); - fprintf(stderr, "device %02d idcode: %08x name: %-16s family: %s\n", - n, info->idcode, info->name, info->family); } fprintf(stderr, "too many devices\n"); return -1; } +void jtag_print_chain(JTAG *jtag) { + int n; + for (n = 0; n < jtag->devcount; n++) { + JTAG_INFO *info = jtag->devinfo + n; + fprintf(stderr, "device %02d idcode: %08x name: %-16s family: %s\n", + n, info->idcode, info->name, info->family); + } +} + JTAG_INFO *jtag_get_nth_device(JTAG *jtag, int n) { if ((n >= jtag->devcount) || (n < 0)) { return NULL;