From 302c86fa8056fc91ecb09cf0b4a129a3d8288392 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Thu, 21 May 2015 18:56:07 +0200 Subject: Simplify --- redbutton.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'redbutton.go') 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) } -- cgit v1.2.3