From ea3b5c74235c730bb3cfd51d15a9cb668dc34941 Mon Sep 17 00:00:00 2001
From: Dean Camera <dean@fourwalledcubicle.com>
Date: Mon, 20 Jun 2011 02:22:34 +0000
Subject: [PATCH] More cosmetic data output changes to the HIDReportViewer
 project.

---
 Projects/HIDReportViewer/HIDReportViewer.c | 23 ++++++++--------------
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/Projects/HIDReportViewer/HIDReportViewer.c b/Projects/HIDReportViewer/HIDReportViewer.c
index 1dfbd4058..6d48aca78 100644
--- a/Projects/HIDReportViewer/HIDReportViewer.c
+++ b/Projects/HIDReportViewer/HIDReportViewer.c
@@ -123,7 +123,7 @@ int main(void)
 			case HOST_STATE_Configured:
 				LEDs_SetAllLEDs(LEDMASK_USB_BUSY);
 				
-				printf_P(PSTR("\r\n\r\nTotal Reports: %" PRId8 "\r\n"), HIDReportInfo.TotalDeviceReports);
+				printf_P(PSTR("\r\n\r\nTotal Device Reports: %" PRId8 "\r\n"), HIDReportInfo.TotalDeviceReports);
 				for (uint8_t ReportIndex = 0; ReportIndex < HIDReportInfo.TotalDeviceReports; ReportIndex++)
 				{
 					HID_ReportSizeInfo_t* CurrReportIDInfo = &HIDReportInfo.ReportIDSizes[ReportIndex];
@@ -146,7 +146,7 @@ int main(void)
 					         ((ReportSizeFeatureBits >> 3) + ((ReportSizeFeatureBits & 0x07) != 0)));
 				}
 				
-				puts_P(PSTR("\r\nReport Items:\r\n"));
+				printf_P(PSTR("\r\nReport Items (%" PRId8 " Stored in Table):\r\n"), HIDReportInfo.TotalReportItems);
 				for (uint8_t ItemIndex = 0; ItemIndex < HIDReportInfo.TotalReportItems; ItemIndex++)
 				{
 					const HID_ReportItem_t* RItem = &HIDReportInfo.ReportItems[ItemIndex];
@@ -182,22 +182,15 @@ int main(void)
 					         RItem->Attributes.Physical.Maximum);
 					
 					const HID_CollectionPath_t* CollectionPath  = RItem->CollectionPath;
-					uint8_t                     CollectionDepth = 6;
 					
 					while (CollectionPath != NULL)
 					{
-						for (uint8_t i = 0; i < CollectionDepth; i++)
-						  putchar(' ');
-
-						printf_P(PSTR("- Type:  0x%02" PRIX8 "\r\n"), CollectionPath->Type);
-					
-						for (uint8_t i = 0; i < CollectionDepth; i++)
-						  putchar(' ');
-
-						printf_P(PSTR("- Usage: 0x%02" PRIX8 "\r\n"), CollectionPath->Usage);
-
-						CollectionDepth += 3;
-						CollectionPath   = CollectionPath->Parent;
+						printf_P(PSTR("      |\r\n"
+						              "      - Type:  0x%02" PRIX8 "\r\n"
+						              "      - Usage: 0x%02" PRIX8 "\r\n"),
+						              CollectionPath->Type, CollectionPath->Usage);
+						
+						CollectionPath = CollectionPath->Parent;
 					}
 				}
 				
-- 
GitLab