File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -67,11 +67,11 @@ USBTester::~USBTester()
67
67
68
68
const char *USBTester::get_desc_string (const uint8_t *desc)
69
69
{
70
- static char ret_string[128 ] = {};
70
+ static char ret_string[128 ] = { };
71
71
const uint8_t desc_size = desc[0 ] - 2 ;
72
72
const uint8_t *desc_str = &desc[2 ];
73
73
uint32_t j = 0 ;
74
- for (uint32_t i = 0 ; i < desc_size; i+= 2 , j++) {
74
+ for (uint32_t i = 0 ; i < desc_size; i += 2 , j++) {
75
75
ret_string[j] = desc_str[i];
76
76
}
77
77
ret_string[j] = ' \0 ' ;
@@ -80,7 +80,7 @@ const char *USBTester::get_desc_string(const uint8_t *desc)
80
80
81
81
void USBTester::suspend (bool suspended)
82
82
{
83
- if (suspended) {
83
+ if (suspended) {
84
84
++suspend_count;
85
85
} else {
86
86
++resume_count;
@@ -146,7 +146,7 @@ void USBTester::callback_request(const setup_packet_t *setup)
146
146
case VENDOR_TEST_CTRL_OUT:
147
147
result = Receive;
148
148
data = ctrl_buf;
149
- size = setup->wValue < 8 ? setup->wValue : 8 ;
149
+ size = setup->wValue < 8 ? setup->wValue : 8 ;
150
150
break ;
151
151
case VENDOR_TEST_CTRL_NONE:
152
152
result = Success;
@@ -176,8 +176,6 @@ void USBTester::callback_request(const setup_packet_t *setup)
176
176
} else {
177
177
complete_request (result, data, size);
178
178
}
179
-
180
-
181
179
}
182
180
183
181
void USBTester::callback_request_xfer_done (const setup_packet_t *setup, bool aborted)
Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ bool USBDevice::_request_get_descriptor()
62
62
#endif
63
63
switch (DESCRIPTOR_TYPE (_transfer.setup .wValue )) {
64
64
case DEVICE_DESCRIPTOR:
65
+ {
65
66
if (device_desc () != NULL ) {
66
67
if ((device_desc ()[0 ] == DEVICE_DESCRIPTOR_LENGTH) \
67
68
&& (device_desc ()[1 ] == DEVICE_DESCRIPTOR)) {
@@ -75,6 +76,7 @@ bool USBDevice::_request_get_descriptor()
75
76
}
76
77
}
77
78
break ;
79
+ }
78
80
case CONFIGURATION_DESCRIPTOR:
79
81
{
80
82
const uint8_t idx = DESCRIPTOR_INDEX (_transfer.setup .wValue );
@@ -96,6 +98,7 @@ bool USBDevice::_request_get_descriptor()
96
98
break ;
97
99
}
98
100
case STRING_DESCRIPTOR:
101
+ {
99
102
#ifdef DEBUG
100
103
printf (" str descriptor\r\n " );
101
104
#endif
@@ -156,21 +159,29 @@ bool USBDevice::_request_get_descriptor()
156
159
break ;
157
160
}
158
161
break ;
162
+ }
159
163
case INTERFACE_DESCRIPTOR:
164
+ {
160
165
#ifdef DEBUG
161
166
printf (" interface descr\r\n " );
162
167
#endif
168
+ break ;
169
+ }
163
170
case ENDPOINT_DESCRIPTOR:
171
+ {
164
172
#ifdef DEBUG
165
173
printf (" endpoint descr\r\n " );
166
174
#endif
167
175
/* TODO: Support is optional, not implemented here */
168
176
break ;
177
+ }
169
178
default :
179
+ {
170
180
#ifdef DEBUG
171
181
printf (" ERROR\r\n " );
172
182
#endif
173
183
break ;
184
+ }
174
185
}
175
186
176
187
return success;
@@ -406,7 +417,6 @@ void USBDevice::_complete_set_configuration()
406
417
_phy->ep0_stall ();
407
418
return ;
408
419
}
409
-
410
420
}
411
421
412
422
bool USBDevice::_request_get_configuration ()
You can’t perform that action at this time.
0 commit comments