From 733fee47fc432778a91f8e045bf7e7e004b96170 Mon Sep 17 00:00:00 2001 From: Adam Kramer Date: Sat, 7 Mar 2015 18:53:00 -0800 Subject: [PATCH] Fixing a bug (oops) --- rpio.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rpio.go b/rpio.go index 15515bc..3589068 100644 --- a/rpio.go +++ b/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) }