eqooo
Posts: 19
Joined: Tue May 21, 2013 6:59 am

Serial Receive Interrupt ???

Mon Jul 22, 2013 12:26 pm

Hi everyone.
I need to learn about interrupts. How can I do an interrupt when data is receive to RPi ? I'm using Raspbian.
Has any idea about it?

User avatar
gordon@drogon.net
Posts: 2020
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: Serial Receive Interrupt ???

Wed Jul 24, 2013 9:42 pm

eqooo wrote:Hi everyone.
I need to learn about interrupts. How can I do an interrupt when data is receive to RPi ? I'm using Raspbian.
Has any idea about it?
You can use pthreads - create a thread that simply waits on data being avalable at the serial port and it will wake up when data is there - that's the easiest you'll get to an interrupt in userland under Linux. When the thread wakes up, you can then process the data, etc.

-Gordon
--
Gordons projects: https://projects.drogon.net/

Return to “C/C++”