From d0385e4ccb98b81cdac68ab0c76e90182ad8a978 Mon Sep 17 00:00:00 2001 From: deadprogram Date: Tue, 25 Apr 2017 11:57:25 +0200 Subject: [PATCH] tinkerboard: corrections needed for sysfs.PWMPin Signed-off-by: deadprogram --- platforms/tinkerboard/adaptor.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/platforms/tinkerboard/adaptor.go b/platforms/tinkerboard/adaptor.go index 8aa82915..8231097e 100644 --- a/platforms/tinkerboard/adaptor.go +++ b/platforms/tinkerboard/adaptor.go @@ -3,7 +3,6 @@ package tinkerboard import ( "errors" "fmt" - "strconv" multierror "github.com/hashicorp/go-multierror" "gobot.io/x/gobot" @@ -101,11 +100,7 @@ func (c *Adaptor) PwmWrite(pin string, val byte) (err error) { if err != nil { return } - p, err := pwmPin.Period() - if err != nil { - return err - } - period, err := strconv.Atoi(p) + period, err := pwmPin.Period() if err != nil { return err } @@ -199,7 +194,7 @@ func (c *Adaptor) pwmPin(pin string) (sysfsPin *sysfs.PWMPin, err error) { if err = newPin.SetPeriod(10000000); err != nil { return } - if err = newPin.SetPolarityInverted(false); err != nil { + if err = newPin.InvertPolarity(false); err != nil { return } c.pwmPins[sysPin.pwmPin] = newPin