mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-18 03:24:00 +00:00
machine/usb: add back New() with deprecation comment to use Port() instead
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
@@ -63,6 +63,12 @@ func init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// New returns the USB hid-keyboard port.
|
||||||
|
// Deprecated, better to just use Port()
|
||||||
|
func New() *keyboard {
|
||||||
|
return Port()
|
||||||
|
}
|
||||||
|
|
||||||
// Port returns the USB hid-keyboard port.
|
// Port returns the USB hid-keyboard port.
|
||||||
func Port() *keyboard {
|
func Port() *keyboard {
|
||||||
return Keyboard
|
return Keyboard
|
||||||
|
|||||||
@@ -27,6 +27,12 @@ func init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// New returns the USB hid-mouse port.
|
||||||
|
// Deprecated, better to just use Port()
|
||||||
|
func New() *mouse {
|
||||||
|
return Port()
|
||||||
|
}
|
||||||
|
|
||||||
// Port returns the USB hid-mouse port.
|
// Port returns the USB hid-mouse port.
|
||||||
func Port() *mouse {
|
func Port() *mouse {
|
||||||
return Mouse
|
return Mouse
|
||||||
|
|||||||
@@ -24,6 +24,12 @@ func init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// New returns the USB MIDI port.
|
||||||
|
// Deprecated, better to just use Port()
|
||||||
|
func New() *midi {
|
||||||
|
return Port()
|
||||||
|
}
|
||||||
|
|
||||||
// Port returns the USB midi port.
|
// Port returns the USB midi port.
|
||||||
func Port() *midi {
|
func Port() *midi {
|
||||||
return Midi
|
return Midi
|
||||||
|
|||||||
Reference in New Issue
Block a user