mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-11 22:43:40 +00:00
machine/usb: refactoring descriptors into subpackage for modularity
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package descriptor
|
||||
|
||||
const (
|
||||
classSpecificTypeLen = 5
|
||||
)
|
||||
|
||||
type ClassSpecificType struct {
|
||||
data []byte
|
||||
}
|
||||
|
||||
func (d ClassSpecificType) Bytes() []byte {
|
||||
return d.data[:d.data[0]]
|
||||
}
|
||||
|
||||
func (d ClassSpecificType) Length(v uint8) {
|
||||
d.data[0] = byte(v)
|
||||
}
|
||||
Reference in New Issue
Block a user