File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,7 @@ export class RPUSBController extends BasePeripheral {
113113
114114 private readonly endpointReadAlarms : USBEndpointAlarm [ ] ;
115115 private readonly endpointWriteAlarms : USBEndpointAlarm [ ] ;
116+ private readonly resetAlarm ;
116117
117118 onUSBEnabled ?: ( ) => void ;
118119 onResetReceived ?: ( ) => void ;
@@ -153,6 +154,10 @@ export class RPUSBController extends BasePeripheral {
153154 ) ,
154155 ) ;
155156 }
157+ this . resetAlarm = clock . createAlarm ( ( ) => {
158+ this . sieStatus |= SIE_BUS_RESET ;
159+ this . sieStatusUpdated ( ) ;
160+ } ) ;
156161 }
157162
158163 readUint32 ( offset : number ) {
@@ -313,8 +318,7 @@ export class RPUSBController extends BasePeripheral {
313318 }
314319
315320 resetDevice ( ) {
316- this . sieStatus |= SIE_BUS_RESET ;
317- this . sieStatusUpdated ( ) ;
321+ this . resetAlarm . schedule ( 10_000_000 ) ; // USB reset takes ~10ms
318322 }
319323
320324 sendSetupPacket ( setupPacket : Uint8Array ) {
You can’t perform that action at this time.
0 commit comments