mirror of
https://github.com/stianeikeland/go-rpio.git
synced 2025-02-02 15:30:36 +01:00
Fixing a bug (oops)
This commit is contained in:
parent
cf3a8b7ed1
commit
733fee47fc
8
rpio.go
8
rpio.go
|
@ -58,6 +58,7 @@ package rpio
|
|||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"os"
|
||||
"reflect"
|
||||
"sync"
|
||||
|
@ -323,10 +324,11 @@ func getGPIOBase() (base int64) {
|
|||
return
|
||||
}
|
||||
buf := bytes.NewReader(b)
|
||||
var out int64
|
||||
err = binary.Read(buf, binary.LittleEndian, &out)
|
||||
var out uint32
|
||||
err = binary.Read(buf, binary.BigEndian, &out)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
return out + 0x200000
|
||||
fmt.Printf("%X", out)
|
||||
return int64(out + 0x200000)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user