Skip site navigation (1)Skip section navigation (2)
Date:      05 Aug 2003 17:30:07 -0400
From:      "J. Seth Henry" <jshamlet@comcast.net>
To:        freebsd-questions@freebsd.org
Subject:   FreeBSD programming question
Message-ID:  <1060119004.53095.25.camel@alexandria>

next in thread | raw e-mail | index | archive | help
Not sure if this is the right list or not, but I could really use some
pointers.

How can I code trap serial port interrupts in my C program?

For example, I want to read values from a serial device every
user-specified number of seconds, calculate some stuff and then sit for
a while. Should the serial device decide it wants to send some data
unsolicited, I would like to enter an interrupt service routine, handle
the communication, and then return to the previous loop.

I can get the loop going by using sleep(n), but I don't know how to
write the ISR in C, and (additionally) make it such that it will run on
any *nix like platform. 

Any pointers, HOWTO's, or examples would be greatly appreciated!

Thanks,
Seth



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1060119004.53095.25.camel>