From c3f9b4ae5d300a937186a6a55763e9005be2a171 Mon Sep 17 00:00:00 2001 From: deadprogram Date: Mon, 1 May 2017 10:31:36 +0200 Subject: [PATCH] joule: implement DigitalPinnerProvider and PWMPinnerProvider interfaces Signed-off-by: deadprogram --- platforms/intel-iot/joule/joule_adaptor.go | 4 ++-- platforms/intel-iot/joule/joule_adaptor_test.go | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/platforms/intel-iot/joule/joule_adaptor.go b/platforms/intel-iot/joule/joule_adaptor.go index ad03f0ab..aebcbb59 100644 --- a/platforms/intel-iot/joule/joule_adaptor.go +++ b/platforms/intel-iot/joule/joule_adaptor.go @@ -78,7 +78,7 @@ func (e *Adaptor) Finalize() (err error) { } // digitalPin returns matched digitalPin for specified values -func (e *Adaptor) DigitalPin(pin string, dir string) (sysfsPin *sysfs.DigitalPin, err error) { +func (e *Adaptor) DigitalPin(pin string, dir string) (sysfsPin sysfs.DigitalPinner, err error) { i := sysfsPinMap[pin] if e.digitalPins[i.pin] == nil { e.digitalPins[i.pin] = sysfs.NewDigitalPin(i.pin) @@ -132,7 +132,7 @@ func (e *Adaptor) PwmWrite(pin string, val byte) (err error) { } // PWMPin returns a sysfs.PWMPin -func (e *Adaptor) PWMPin(pin string) (sysfsPin *sysfs.PWMPin, err error) { +func (e *Adaptor) PWMPin(pin string) (sysfsPin sysfs.PWMPinner, err error) { sysPin := sysfsPinMap[pin] if sysPin.pwmPin != -1 { if e.pwmPins[sysPin.pwmPin] == nil { diff --git a/platforms/intel-iot/joule/joule_adaptor_test.go b/platforms/intel-iot/joule/joule_adaptor_test.go index 45ede44d..52cf056f 100644 --- a/platforms/intel-iot/joule/joule_adaptor_test.go +++ b/platforms/intel-iot/joule/joule_adaptor_test.go @@ -17,6 +17,8 @@ var _ gobot.Adaptor = (*Adaptor)(nil) var _ gpio.DigitalReader = (*Adaptor)(nil) var _ gpio.DigitalWriter = (*Adaptor)(nil) var _ gpio.PwmWriter = (*Adaptor)(nil) +var _ sysfs.DigitalPinnerProvider = (*Adaptor)(nil) +var _ sysfs.PWMPinnerProvider = (*Adaptor)(nil) var _ i2c.Connector = (*Adaptor)(nil) func initTestAdaptor() (*Adaptor, *sysfs.MockFilesystem) {