mrmorphic / hwio

Go library for hardware I/O control, in the programming style of Arduino
BSD 3-Clause "New" or "Revised" License
328 stars 40 forks source link

O-SYNC needed for memory mapped GPIO ? #2

Closed rickb777 closed 11 years ago

rickb777 commented 11 years ago

This is a question as much as anything.

Another blog (http://41j.com/blog/2011/09/beagleboard-gpio-input-driverless/) insists that O_SYNC is needed for opening /dev/mem. Is the blogger correct in this?

If so, driver_pi.go line 141 should become

file, e := os.OpenFile("/dev/mem", os.O_RDWR | os.O_APPEND | os.O_SYNC, 0)

A similar change is needed for driver_beagle.go line 386.

mrmorphic commented 11 years ago

Hi. Sorry for the delayed response.

Thanks for pointing that article out; I hadn't seen that option. I'll change both the drivers in the next day or so.

M On 3/04/2013 12:05 PM, "Rick" notifications@github.com wrote:

This is a question as much as anything.

Another blog ( http://41j.com/blog/2011/09/beagleboard-gpio-input-driverless/) insists that O_SYNC is needed for opening /dev/mem. Is the blogger correct in this?

If so, driver_pi.go line 141 should become

file, e := os.OpenFile("/dev/mem", os.O_RDWR | os.O_APPEND | os.O_SYNC, 0)

A similar change is needed for driver_beagle.go line 386.

— Reply to this email directly or view it on GitHubhttps://github.com/mrmorphic/hwio/issues/2 .

mrmorphic commented 11 years ago

This issue is now fixed.