Fixing a bug (oops)

This commit is contained in:
Adam Kramer 2015-03-07 18:53:00 -08:00
parent cf3a8b7ed1
commit 733fee47fc

View File

@ -58,6 +58,7 @@ package rpio
import ( import (
"bytes" "bytes"
"encoding/binary" "encoding/binary"
"fmt"
"os" "os"
"reflect" "reflect"
"sync" "sync"
@ -323,10 +324,11 @@ func getGPIOBase() (base int64) {
return return
} }
buf := bytes.NewReader(b) buf := bytes.NewReader(b)
var out int64 var out uint32
err = binary.Read(buf, binary.LittleEndian, &out) err = binary.Read(buf, binary.BigEndian, &out)
if err != nil { if err != nil {
return return
} }
return out + 0x200000 fmt.Printf("%X", out)
return int64(out + 0x200000)
} }