From 1d6fbcbd219887a44dfb2a5d82dd22aef18dc8e2 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Thu, 10 Feb 2011 23:43:36 -0300 Subject: [PATCH] atrf-id.c (show_usb_info): pretty-print the MCU type for ATUSB boards --- tools/atrf-id/atrf-id.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/atrf-id/atrf-id.c b/tools/atrf-id/atrf-id.c index 89d7871..6929d10 100644 --- a/tools/atrf-id/atrf-id.c +++ b/tools/atrf-id/atrf-id.c @@ -76,6 +76,7 @@ static void show_usb_info(struct atrf_dsc *dsc) usb_dev_handle *dev; const struct usb_device *device; uint8_t major, minor, target; + const char *mcu; char buf[BUF_SIZE+1]; /* +1 for terminating \0 */ int len; @@ -89,7 +90,18 @@ static void show_usb_info(struct atrf_dsc *dsc) if (get_protocol(dev, &major, &minor, &target) < 0) exit(1); - printf("protocol %u.%u hw %u\n", major, minor, target); + switch (target) { + case HW_TYPE_100813: + case HW_TYPE_101216: + mcu = "C8051F326"; + break; + case HW_TYPE_110131: + mcu = "ATmega32U2"; + break; + default: + mcu = "???"; + } + printf("protocol %u.%u hw %u (%s)\n", major, minor, target, mcu); len = get_build(dev, buf, sizeof(buf)-1); if (len < 0)