beagleboard / am335x_pru_package

331 stars 181 forks source link

added: variant of prussdrv_pru_wait_event() with timeout #57

Closed faryon93 closed 7 years ago

faryon93 commented 7 years ago

Some day I needed a version of prussdrv_pru_wait_event() with a configurable timeout and thought I should share it with you. With the parameter "time_us" of prussdrv_pru_wait_event_timeout() one can configure the timeout in Microseconds.

A return value of -1 indicates an error while waiting for the PRU event. If a timeout occurs the function returns 0. Otherwise the return value behaves like in prussdrv_pru_wait_event()