chip: correct ]base for new 4.4 GPIO
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
parent
7af92e875d
commit
4d628eebbc
|
@ -10,7 +10,7 @@ import (
|
|||
|
||||
func main() {
|
||||
chipAdaptor := chip.NewAdaptor()
|
||||
led := gpio.NewLedDriver(chipAdaptor, "XIO-P0")
|
||||
led := gpio.NewLedDriver(chipAdaptor, "XIO-P6")
|
||||
|
||||
work := func() {
|
||||
gobot.Every(1*time.Second, func() {
|
||||
|
|
|
@ -29,14 +29,14 @@ var pinsOriginal = map[string]int{
|
|||
}
|
||||
|
||||
var pins44 = map[string]int{
|
||||
"XIO-P0": 1016,
|
||||
"XIO-P1": 1017,
|
||||
"XIO-P2": 1018,
|
||||
"XIO-P3": 1019,
|
||||
"XIO-P4": 1020,
|
||||
"XIO-P5": 1021,
|
||||
"XIO-P6": 1022,
|
||||
"XIO-P7": 1023,
|
||||
"XIO-P0": 1013,
|
||||
"XIO-P1": 1014,
|
||||
"XIO-P2": 1015,
|
||||
"XIO-P3": 1016,
|
||||
"XIO-P4": 1017,
|
||||
"XIO-P5": 1018,
|
||||
"XIO-P6": 1019,
|
||||
"XIO-P7": 1020,
|
||||
}
|
||||
|
||||
// NewAdaptor creates a C.H.I.P. Adaptor
|
||||
|
|
|
@ -55,18 +55,18 @@ func TestChipAdaptorDigitalIO(t *testing.T) {
|
|||
fs := sysfs.NewMockFilesystem([]string{
|
||||
"/sys/class/gpio/export",
|
||||
"/sys/class/gpio/unexport",
|
||||
"/sys/class/gpio/gpio1016/value",
|
||||
"/sys/class/gpio/gpio1016/direction",
|
||||
"/sys/class/gpio/gpio1023/value",
|
||||
"/sys/class/gpio/gpio1023/direction",
|
||||
"/sys/class/gpio/gpio1013/value",
|
||||
"/sys/class/gpio/gpio1013/direction",
|
||||
"/sys/class/gpio/gpio1020/value",
|
||||
"/sys/class/gpio/gpio1020/direction",
|
||||
})
|
||||
|
||||
sysfs.SetFilesystem(fs)
|
||||
|
||||
a.DigitalWrite("XIO-P0", 1)
|
||||
gobottest.Assert(t, fs.Files["/sys/class/gpio/gpio1016/value"].Contents, "1")
|
||||
gobottest.Assert(t, fs.Files["/sys/class/gpio/gpio1013/value"].Contents, "1")
|
||||
|
||||
fs.Files["/sys/class/gpio/gpio1023/value"].Contents = "1"
|
||||
fs.Files["/sys/class/gpio/gpio1020/value"].Contents = "1"
|
||||
i, _ := a.DigitalRead("XIO-P7")
|
||||
gobottest.Assert(t, i, 1)
|
||||
|
||||
|
|
Loading…
Reference in New Issue