zhemao / interrupt_example

An example of how to use Avalon interrupts on the Cyclone V FPGA
13 stars 8 forks source link

how to create a nonblocking read #4

Closed sierrarun closed 8 years ago

sierrarun commented 8 years ago

Hello Mao, Thank you for a very informative article. Can you please show how to call a read from userspace without being blocked forever?

I have tried this by changing the "wait_event_interruptible" to "wait_event_interruptible_timeout". However, the timeout resolution is only in multiples of 10ms (since one jiffie is 10ms on my system). I am looking for a way to be able to wait for a delay in usecs times frame and then timeout. Is there a way we can add poll method for the sysfs attribute file? Right now, poll always immediately returns. Thanks Sierrarun

sierrarun commented 8 years ago

Hello, I have been able to use hr timers to timeout from wait_event_interruptible call in the resolution of usecs. You can close this issue. Thanks Sierrarun.