mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-12 23:13:40 +00:00
machine/usb/hid: rename Handler() to TxHandler()
This commit is contained in:
@@ -23,7 +23,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type hidDevicer interface {
|
type hidDevicer interface {
|
||||||
Handler() bool
|
TxHandler() bool
|
||||||
RxHandler([]byte) bool
|
RxHandler([]byte) bool
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ func SetHandler(d hidDevicer) {
|
|||||||
Index: usb.HID_ENDPOINT_IN,
|
Index: usb.HID_ENDPOINT_IN,
|
||||||
IsIn: true,
|
IsIn: true,
|
||||||
Type: usb.ENDPOINT_TYPE_INTERRUPT,
|
Type: usb.ENDPOINT_TYPE_INTERRUPT,
|
||||||
TxHandler: handler,
|
TxHandler: txHandler,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
[]usb.SetupConfig{
|
[]usb.SetupConfig{
|
||||||
@@ -55,12 +55,12 @@ func SetHandler(d hidDevicer) {
|
|||||||
size++
|
size++
|
||||||
}
|
}
|
||||||
|
|
||||||
func handler() {
|
func txHandler() {
|
||||||
for _, d := range devices {
|
for _, d := range devices {
|
||||||
if d == nil {
|
if d == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if done := d.Handler(); done {
|
if done := d.TxHandler(); done {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ func newKeyboard() *keyboard {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (kb *keyboard) Handler() bool {
|
func (kb *keyboard) TxHandler() bool {
|
||||||
kb.waitTxc = false
|
kb.waitTxc = false
|
||||||
if b, ok := kb.buf.Get(); ok {
|
if b, ok := kb.buf.Get(); ok {
|
||||||
kb.waitTxc = true
|
kb.waitTxc = true
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ func newMouse() *mouse {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *mouse) Handler() bool {
|
func (m *mouse) TxHandler() bool {
|
||||||
m.waitTxc = false
|
m.waitTxc = false
|
||||||
if b, ok := m.buf.Get(); ok {
|
if b, ok := m.buf.Get(); ok {
|
||||||
m.waitTxc = true
|
m.waitTxc = true
|
||||||
|
|||||||
Reference in New Issue
Block a user