Skip to content

Conversation

@mikesmitty
Copy link
Contributor

@mikesmitty mikesmitty commented Dec 5, 2025

I mentioned this in a comment on #5109, this is a small refactor of the machine and usb package interactions (and some other changes mixed in that will be created as separate PRs and rebased later on). This creates a usb.Controller interface for use in the USB-related packages for mocking in unit testing and updates machine.USBDev to implement it:

type Controller interface {
	ConfigureUSBEndpoint(desc descriptor.Descriptor, epSettings []EndpointConfig, setup []SetupConfig)
	SendUSBInPacket(ep uint32, data []byte) bool
	AckUsbOutTransfer(ep uint32)
	SendZlp()
	IsInitEndpointComplete() bool
	SetStallEPIn(ep uint32)
	SetStallEPOut(ep uint32)
	ClearStallEPIn(ep uint32)
	ClearStallEPOut(ep uint32)
}

@mikesmitty mikesmitty force-pushed the ms/usb-msc-unit-testing branch 2 times, most recently from 0ce6776 to 7fc576b Compare December 5, 2025 14:07
@mikesmitty mikesmitty changed the title refactor(usb): create usb.Controller interface for testing test(usb): create usb.Controller interface for testing Dec 5, 2025
@deadprogram
Copy link
Member

@mikesmitty can you please resolve merge conflicts so I can help review. Thank you!

@mikesmitty mikesmitty force-pushed the ms/usb-msc-unit-testing branch from 7fc576b to 64281df Compare December 6, 2025 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants