diff options
author | Jenna Fox <a@creativepony.com> | 2012-09-26 21:46:10 +1000 |
---|---|---|
committer | Jenna Fox <a@creativepony.com> | 2012-09-26 21:46:10 +1000 |
commit | 2bf95cd6288a5560e7f0dce144e57583674920ec (patch) | |
tree | 409af3d0f99b3e336a14c2fd3dfaba486d4ad5d7 | |
parent | 8a578076dbb542a0e1218e93a2ae1cfa735ef964 (diff) | |
download | micronucleus-2bf95cd6288a5560e7f0dce144e57583674920ec.tar.gz micronucleus-2bf95cd6288a5560e7f0dce144e57583674920ec.tar.bz2 micronucleus-2bf95cd6288a5560e7f0dce144e57583674920ec.zip |
nicer usb_request_type internal calculator method from @larskanis
-rw-r--r-- | firmware/microboot.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/firmware/microboot.rb b/firmware/microboot.rb index 0b3ec58..c719e83 100644 --- a/firmware/microboot.rb +++ b/firmware/microboot.rb @@ -108,14 +108,12 @@ class MicroBoot timeout: 5000 }.merge opts) end - - - - def usb_request_type opts - c = LIBUSB::Call - value = c::RequestTypes[:REQUEST_TYPE_VENDOR] | c::RequestRecipients[:RECIPIENT_DEVICE] - value |= c::EndpointDirections[:ENDPOINT_OUT] if opts.has_key? :dataOut - value |= c::EndpointDirections[:ENDPOINT_IN] if opts.has_key? :dataIn + + # calculate usb request type + def usb_request_type opts #:nodoc: + value = LIBUSB::REQUEST_TYPE_VENDOR | LIBUSB::RECIPIENT_DEVICE + value |= LIBUSB::ENDPOINT_OUT if opts.has_key? :dataOut + value |= LIBUSB::ENDPOINT_IN if opts.has_key? :dataIn return value end end |