add xbox example and make some changes to support it

This commit is contained in:
Kyle Lemons
2013-06-22 08:38:58 -07:00
parent 98ceb07d97
commit f0081d8ff9
5 changed files with 356 additions and 11 deletions

22
usb/debug.go Normal file
View File

@@ -0,0 +1,22 @@
package usb
// To enable internal debugging:
// -ldflags "-X github.com/kylelemons/gousb/usb.debugInternal true"
import (
"io"
"io/ioutil"
"log" // TODO(kevlar): make a logger
"os"
)
var debug *log.Logger
var debugInternal string
func init() {
var out io.Writer = ioutil.Discard
if debugInternal != "" {
out = os.Stderr
}
debug = log.New(out, "usb", log.LstdFlags|log.Lshortfile)
}