Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lufa
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Erik Strand
lufa
Commits
6e0adb98
Commit
6e0adb98
authored
13 years ago
by
Dean Camera
Browse files
Options
Downloads
Patches
Plain Diff
Switch to using the standard printf() format specifiers in the HIDReportViewer project.
parent
bad956ba
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Projects/Incomplete/HIDReportViewer/HIDReportViewer.c
+20
-20
20 additions, 20 deletions
Projects/Incomplete/HIDReportViewer/HIDReportViewer.c
Projects/Incomplete/HIDReportViewer/HIDReportViewer.h
+1
-0
1 addition, 0 deletions
Projects/Incomplete/HIDReportViewer/HIDReportViewer.h
with
21 additions
and
20 deletions
Projects/Incomplete/HIDReportViewer/HIDReportViewer.c
+
20
−
20
View file @
6e0adb98
...
...
@@ -117,7 +117,7 @@ int main(void)
case
HOST_STATE_Configured
:
LEDs_SetAllLEDs
(
LEDMASK_USB_BUSY
);
printf_P
(
PSTR
(
"
\r\n\r\n
Total Reports: %
d
\r\n
"
),
HIDReportInfo
.
TotalDeviceReports
);
printf_P
(
PSTR
(
"
\r\n\r\n
Total Reports: %
"
PRId8
"
\r\n
"
),
HIDReportInfo
.
TotalDeviceReports
);
for
(
uint8_t
ReportIndex
=
0
;
ReportIndex
<
HIDReportInfo
.
TotalDeviceReports
;
ReportIndex
++
)
{
HID_ReportSizeInfo_t
*
CurrReportIDInfo
=
&
HIDReportInfo
.
ReportIDSizes
[
ReportIndex
];
...
...
@@ -127,7 +127,7 @@ int main(void)
uint8_t
ReportSizeFeatureBits
=
CurrReportIDInfo
->
ReportSizeBits
[
HID_REPORT_ITEM_Feature
];
/* Print out the byte sizes of each report within the device */
printf_P
(
PSTR
(
" + Report ID %
d - In: %d
bytes, Out: %
d
bytes, Feature: %
d
bytes
\r\n
"
),
printf_P
(
PSTR
(
" + Report ID %
"
PRId8
" - In: %"
PRId8
"
bytes, Out: %
"
PRId8
"
bytes, Feature: %
"
PRId8
"
bytes
\r\n
"
),
CurrReportIDInfo
->
ReportID
,
((
ReportSizeInBits
>>
3
)
+
((
ReportSizeInBits
&
0x07
)
!=
0
)),
((
ReportSizeOutBits
>>
3
)
+
((
ReportSizeOutBits
&
0x07
)
!=
0
)),
...
...
@@ -137,22 +137,22 @@ int main(void)
printf_P
(
PSTR
(
"
\r\n\r\n
Report Items: %d
\r\n
"
),
HIDReportInfo
.
TotalDeviceReports
);
for
(
uint8_t
ItemIndex
=
0
;
ItemIndex
<
HIDReportInfo
.
TotalReportItems
;
ItemIndex
++
)
{
HID_ReportItem_t
*
RItem
=
&
HIDReportInfo
.
ReportItems
[
ItemIndex
];
const
HID_ReportItem_t
*
RItem
=
&
HIDReportInfo
.
ReportItems
[
ItemIndex
];
printf_P
(
PSTR
(
" + Item %
d
:
\r\n
"
" - Report ID: 0x%02
X
\r\n
"
printf_P
(
PSTR
(
" + Item %
"
PRId8
"
:
\r\n
"
" - Report ID: 0x%02
"
PRIX8
"
\r\n
"
" - Data Direction: %s
\r\n
"
" - Item Flags: 0x%02
X
\r\n
"
" - Item Offset (Bits): 0x%02
X
\r\n
"
" - Item Size (Bits): 0x%02
X
\r\n
"
" - Usage Page: 0x%04
X
\r\n
"
" - Usage: 0x%04
X
\r\n
"
" - Unit Type: 0x%04
X
\r\n
"
" - Unit Exponent: 0x%02
X
\r\n
"
" - Logical Minimum: 0x%04
X
\r\n
"
" - Logical Maximum: 0x%04
X
\r\n
"
" - Physical Minimum: 0x%04
X
\r\n
"
" - Physical Maximum: 0x%04
X
\r\n
"
" - Item Flags: 0x%02
"
PRIX8
"
\r\n
"
" - Item Offset (Bits): 0x%02
"
PRIX8
"
\r\n
"
" - Item Size (Bits): 0x%02
"
PRIX8
"
\r\n
"
" - Usage Page: 0x%04
"
PRIX32
"
\r\n
"
" - Usage: 0x%04
"
PRIX32
"
\r\n
"
" - Unit Type: 0x%04
"
PRIX32
"
\r\n
"
" - Unit Exponent: 0x%02
"
PRIX8
"
\r\n
"
" - Logical Minimum: 0x%04
"
PRIX32
"
\r\n
"
" - Logical Maximum: 0x%04
"
PRIX32
"
\r\n
"
" - Physical Minimum: 0x%04
"
PRIX32
"
\r\n
"
" - Physical Maximum: 0x%04
"
PRIX32
"
\r\n
"
" - Collection Path:
\r\n
"
),
ItemIndex
,
RItem
->
ReportID
,
...
...
@@ -169,20 +169,20 @@ int main(void)
RItem
->
Attributes
.
Physical
.
Minimum
,
RItem
->
Attributes
.
Physical
.
Maximum
);
HID_CollectionPath_t
*
CollectionPath
=
RItem
->
CollectionPath
;
uint8_t
CollectionDepth
=
6
;
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
X
\r\n
"
),
CollectionPath
->
Type
);
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
X
\r\n
"
),
CollectionPath
->
Usage
);
printf_P
(
PSTR
(
"- Usage: 0x%02
"
PRIX8
"
\r\n
"
),
CollectionPath
->
Usage
);
CollectionDepth
+=
3
;
CollectionPath
=
CollectionPath
->
Parent
;
...
...
This diff is collapsed.
Click to expand it.
Projects/Incomplete/HIDReportViewer/HIDReportViewer.h
+
1
−
0
View file @
6e0adb98
...
...
@@ -43,6 +43,7 @@
#include
<avr/power.h>
#include
<avr/interrupt.h>
#include
<stdio.h>
#include
<inttypes.h>
#include
<LUFA/Version.h>
#include
<LUFA/Drivers/Misc/TerminalCodes.h>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment