From a981174b2f6d254cf6e0ca53712b27811084c56d Mon Sep 17 00:00:00 2001 From: sago35 Date: Thu, 3 Aug 2023 20:43:04 +0900 Subject: [PATCH] machine/usb/hid: rename Handler() to TxHandler() --- src/machine/usb/hid/hid.go | 8 ++++---- src/machine/usb/hid/keyboard/keyboard.go | 2 +- src/machine/usb/hid/mouse/mouse.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/machine/usb/hid/hid.go b/src/machine/usb/hid/hid.go index e3948dc410..f7f1ff66bf 100644 --- a/src/machine/usb/hid/hid.go +++ b/src/machine/usb/hid/hid.go @@ -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 } } diff --git a/src/machine/usb/hid/keyboard/keyboard.go b/src/machine/usb/hid/keyboard/keyboard.go index d39321410b..237d79419e 100644 --- a/src/machine/usb/hid/keyboard/keyboard.go +++ b/src/machine/usb/hid/keyboard/keyboard.go @@ -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 diff --git a/src/machine/usb/hid/mouse/mouse.go b/src/machine/usb/hid/mouse/mouse.go index 024c1e9c3a..d790bdbb83 100644 --- a/src/machine/usb/hid/mouse/mouse.go +++ b/src/machine/usb/hid/mouse/mouse.go @@ -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