Hi Jack,

On Fri, Oct 18, 2013 at 3:22 PM, Paul Tan <[email protected]> wrote:

> Thanks, I'll try to see if there is a difference with libsoc or not.
>  However, I did manage to get it working with low level unix i/o (open,
> write) instead of the buffered stream i/o (fopen, fwrite).  It works
> correctly, I didn't need a seek operation, and I was able to get pulse
> widths down to 10uS reliably.  Interesting difference though: fwrite
> to "/sys/class/gpio/export" succeeds even if GPIO30 was already exported,
> but write to "/sys/class/gpio/export" fails if GPIO30 was already exported.
>

That's because fwrite is using buffered I/O. If you put the FILE * in
unbuffered mode then you'd find that it would fail too. By default, files
opened with fopen are fully buffered. The buffer size typically around 4K
or so, and the operations that will trigger flusing that data are normally
things like fseek, fread, fflush, or the buffer getting full. The operation
which actually triggers the low-level write will be the one that fails.

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to