diff options
author | Felix Lange <fjl@users.noreply.github.com> | 2018-11-30 17:22:53 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-11-30 17:22:53 +0800 |
commit | ef8ced4151006c84e77ab8db88cf6fc1bb09a716 (patch) | |
tree | d7ec8730fcbed12ff70d1731e9fb799ad2cd5d8b /vendor | |
parent | 7e7781ffaa5c5486c5e7b66dea4986e063524f63 (diff) | |
download | go-tangerine-ef8ced4151006c84e77ab8db88cf6fc1bb09a716.tar go-tangerine-ef8ced4151006c84e77ab8db88cf6fc1bb09a716.tar.gz go-tangerine-ef8ced4151006c84e77ab8db88cf6fc1bb09a716.tar.bz2 go-tangerine-ef8ced4151006c84e77ab8db88cf6fc1bb09a716.tar.lz go-tangerine-ef8ced4151006c84e77ab8db88cf6fc1bb09a716.tar.xz go-tangerine-ef8ced4151006c84e77ab8db88cf6fc1bb09a716.tar.zst go-tangerine-ef8ced4151006c84e77ab8db88cf6fc1bb09a716.zip |
vendor: update github.com/karalabe/hid (#18213)
Fixes #15101 because hidapi is no longer being called from an
init function.
Diffstat (limited to 'vendor')
-rw-r--r-- | vendor/github.com/karalabe/hid/appveyor.yml | 4 | ||||
-rw-r--r-- | vendor/github.com/karalabe/hid/hid_disabled.go | 2 | ||||
-rw-r--r-- | vendor/github.com/karalabe/hid/hid_enabled.go | 12 | ||||
-rw-r--r-- | vendor/vendor.json | 6 |
4 files changed, 12 insertions, 12 deletions
diff --git a/vendor/github.com/karalabe/hid/appveyor.yml b/vendor/github.com/karalabe/hid/appveyor.yml index f43958747..84b3c95ff 100644 --- a/vendor/github.com/karalabe/hid/appveyor.yml +++ b/vendor/github.com/karalabe/hid/appveyor.yml @@ -22,8 +22,8 @@ environment: install: - rmdir C:\go /s /q - - appveyor DownloadFile https://storage.googleapis.com/golang/go1.8.windows-%GOARCH%.zip - - 7z x go1.8.windows-%GOARCH%.zip -y -oC:\ > NUL + - appveyor DownloadFile https://storage.googleapis.com/golang/go1.10.1.windows-%GOARCH%.zip + - 7z x go1.10.1.windows-%GOARCH%.zip -y -oC:\ > NUL - go version - gcc --version diff --git a/vendor/github.com/karalabe/hid/hid_disabled.go b/vendor/github.com/karalabe/hid/hid_disabled.go index 1f4026379..0f266ba58 100644 --- a/vendor/github.com/karalabe/hid/hid_disabled.go +++ b/vendor/github.com/karalabe/hid/hid_disabled.go @@ -36,7 +36,7 @@ func (info DeviceInfo) Open() (*Device, error) { // Close releases the HID USB device handle. On platforms that this file implements // the method is just a noop. -func (dev *Device) Close() {} +func (dev *Device) Close() error { return nil } // Write sends an output report to a HID device. On platforms that this file // implements the method just returns an error. diff --git a/vendor/github.com/karalabe/hid/hid_enabled.go b/vendor/github.com/karalabe/hid/hid_enabled.go index 419273be6..e95e5792d 100644 --- a/vendor/github.com/karalabe/hid/hid_enabled.go +++ b/vendor/github.com/karalabe/hid/hid_enabled.go @@ -41,6 +41,7 @@ package hid #endif */ import "C" + import ( "errors" "runtime" @@ -57,11 +58,6 @@ import ( // > "subsequent calls will cause the hid manager to release previously enumerated devices" var enumerateLock sync.Mutex -func init() { - // Initialize the HIDAPI library - C.hid_init() -} - // Supported returns whether this platform is supported by the HID library or not. // The goal of this method is to allow programatically handling platforms that do // not support USB HID and not having to fall back to build constraints. @@ -113,6 +109,9 @@ func Enumerate(vendorID uint16, productID uint16) []DeviceInfo { // Open connects to an HID device by its path name. func (info DeviceInfo) Open() (*Device, error) { + enumerateLock.Lock() + defer enumerateLock.Unlock() + path := C.CString(info.Path) defer C.free(unsafe.Pointer(path)) @@ -135,7 +134,7 @@ type Device struct { } // Close releases the HID USB device handle. -func (dev *Device) Close() { +func (dev *Device) Close() error { dev.lock.Lock() defer dev.lock.Unlock() @@ -143,6 +142,7 @@ func (dev *Device) Close() { C.hid_close(dev.device) dev.device = nil } + return nil } // Write sends an output report to a HID device. diff --git a/vendor/vendor.json b/vendor/vendor.json index a4fee11aa..883d02097 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -267,10 +267,10 @@ "revisionTime": "2017-04-30T22:20:11Z" }, { - "checksumSHA1": "UpjhOUZ1+0zNt+iIvdtECSHXmTs=", + "checksumSHA1": "6XsjAARQFvlW6dS15al0ibTFPOQ=", "path": "github.com/karalabe/hid", - "revision": "f00545f9f3748e591590be3732d913c77525b10f", - "revisionTime": "2017-08-21T10:38:37Z", + "revision": "d815e0c1a2e2082a287a2806bc90bc8fc7b276a9", + "revisionTime": "2018-11-28T19:21:57Z", "tree": true }, { |