aboutsummaryrefslogtreecommitdiff
path: root/redbutton.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-05-21 18:56:07 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-05-21 18:56:07 +0200
commit302c86fa8056fc91ecb09cf0b4a129a3d8288392 (patch)
tree6fe593d7fa4cf44ef1cb42708ee2f8f26773bcb2 /redbutton.go
parent1cb19c68d8ef3f525c0c051f60240b07054477a1 (diff)
Simplify
Diffstat (limited to 'redbutton.go')
-rw-r--r--redbutton.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/redbutton.go b/redbutton.go
index 549ed9d..a0e069c 100644
--- a/redbutton.go
+++ b/redbutton.go
@@ -12,7 +12,7 @@ type Button struct {
Lid bool
}
-func GetState(dev *hid.Device) (Button, error) {
+func State(dev *hid.Device) (Button, error) {
buf := make([]byte, 8)
buf[0] = 0x01
buf[7] = 0x02
@@ -35,11 +35,11 @@ func GetState(dev *hid.Device) (Button, error) {
}, nil
}
-func PollState(dev *hid.Device) <-chan Button {
+func Poll(dev *hid.Device) <-chan Button {
ch := make(chan Button)
go func() {
for {
- state, err := GetState(dev)
+ state, err := State(dev)
if err != nil {
panic(err)
}