Skip to content

Commit

Permalink
machine/usb/hid: rename Handler() to TxHandler()
Browse files Browse the repository at this point in the history
  • Loading branch information
sago35 committed Aug 3, 2023
1 parent bfd02e0 commit a981174
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/machine/usb/hid/hid.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const (
)

type hidDevicer interface {
Handler() bool
TxHandler() bool
RxHandler([]byte) bool
}

Expand All @@ -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{
Expand All @@ -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
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/machine/usb/hid/keyboard/keyboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/machine/usb/hid/mouse/mouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a981174

Please sign in to comment.