You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think there is an error in the pmem example for MapAsPOD.
package main
import (
"log""periph.io/x/host/v3/pmem"
)
funcmain() {
// Let's say the CPU has 4 x 32 bits memory mapped registers at the address// 0xDEADBEEF.varreg*[4]uint32iferr:=pmem.MapAsPOD(0xDEADBEAF, reg); err!=nil {
log.Fatal(err)
}
// reg now points to physical memory.
}
It only works when I add a referencing operator to the function call, like so: pmem.MapAsPOD(0xDEADBEAF, ®), so this code works for me:
I think there is an error in the pmem example for MapAsPOD.
It only works when I add a referencing operator to the function call, like so:
pmem.MapAsPOD(0xDEADBEAF, ®)
, so this code works for me:Otherwise, I get an error during runtime:
pmem: require Ptr to Ptr, got invalid
(orgot slice
/got array
).In case this is relevant, I'm compiling for an AT91SAM9G45 with Linux 3.0.0.
The text was updated successfully, but these errors were encountered: