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