mirror of
https://github.com/kidoman/embd
synced 2024-12-22 12:50:19 +01:00
minor cleanup
This commit is contained in:
parent
ebb9dc47fc
commit
3f88b67361
3
bbb.go
3
bbb.go
@ -1,7 +1,6 @@
|
|||||||
package embd
|
package embd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
@ -189,7 +188,7 @@ func (p *bbbAnalogPin) Read() (int, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *bbbAnalogPin) Write(_ int) error {
|
func (p *bbbAnalogPin) Write(_ int) error {
|
||||||
return errors.New("gpio: not implemented")
|
return ErrFeatureNotImplemented
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *bbbAnalogPin) Close() error {
|
func (p *bbbAnalogPin) Close() error {
|
||||||
|
@ -29,4 +29,5 @@ func DescribeHost() (*Descriptor, error) {
|
|||||||
return describer(rev), nil
|
return describer(rev), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var ErrFeatureNotSupport = errors.New("embd: feature is not supported")
|
var ErrFeatureNotSupported = errors.New("embd: requested feature is not supported")
|
||||||
|
var ErrFeatureNotImplemented = errors.New("embd: requested feature is not implemented")
|
||||||
|
2
gpio.go
2
gpio.go
@ -52,7 +52,7 @@ func InitGPIO() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if desc.GPIODriver == nil {
|
if desc.GPIODriver == nil {
|
||||||
return ErrFeatureNotSupport
|
return ErrFeatureNotSupported
|
||||||
}
|
}
|
||||||
|
|
||||||
gpioDriverInstance = desc.GPIODriver()
|
gpioDriverInstance = desc.GPIODriver()
|
||||||
|
2
i2c.go
2
i2c.go
@ -38,7 +38,7 @@ func InitI2C() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if desc.I2CDriver == nil {
|
if desc.I2CDriver == nil {
|
||||||
return ErrFeatureNotSupport
|
return ErrFeatureNotSupported
|
||||||
}
|
}
|
||||||
|
|
||||||
i2cDriverInstance = desc.I2CDriver()
|
i2cDriverInstance = desc.I2CDriver()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user