File tree 1 file changed +3
-4
lines changed 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -174,24 +174,23 @@ func initEndpoint(ep, config uint32) {
174
174
func handleUSBSetAddress (setup usb.Setup ) bool {
175
175
// Using 570μs timeout which is exactly the same as SAMD21.
176
176
177
- const ackTimeout = 570
177
+ const ackTimeout = 570
178
178
rp .USB .SIE_STATUS .Set (rp .USB_SIE_STATUS_ACK_REC )
179
179
sendUSBPacket (0 , []byte {}, 0 )
180
-
180
+
181
181
// Wait for transfer to complete with a timeout.
182
182
t := timer .timeElapsed ()
183
183
for (rp .USB .SIE_STATUS .Get () & rp .USB_SIE_STATUS_ACK_REC ) == 0 {
184
184
if dt := timer .timeElapsed () - t ; dt >= ackTimeout {
185
185
return false
186
186
}
187
187
}
188
-
188
+
189
189
// Set the device address to that requested by host.
190
190
rp .USB .ADDR_ENDP .Set (uint32 (setup .WValueL ) & rp .USB_ADDR_ENDP_ADDRESS_Msk )
191
191
return true
192
192
}
193
193
194
-
195
194
// SendUSBInPacket sends a packet for USB (interrupt in / bulk in).
196
195
func SendUSBInPacket (ep uint32 , data []byte ) bool {
197
196
sendUSBPacket (ep , data , 0 )
You can’t perform that action at this time.
0 commit comments