WinSystems EBC-LP Operation Manual page 87

Small, high-performance, embeddable computer system on a single board
Table of Contents

Advertisement

outportb(0xa1,inportb(0xa1) | 0x02);
/* Restore the old handler */
setvect(0x72,old_handler);
/* Reenable interrupts. Things are back they way they were before we
started.
*/
enable();
}
/* This function is executed when an edge detection interrupt occurs */
void interrupt int_handler(void)
{
int current;
/* Get the current interrupt pending. There really should be one
here or we shouldn't even be executing this function.
*/
current = get_int();
/* We will continue processing pending edge detect interrupts until
there are no more present. In which case current == 0
*/
while(current)
{
/* Clear the current one so that it's ready for the next edge */
clr_int(current);
/* Tally up one for the current bit number */
++int_counts[current];
/* Get the next one, if any others pending */
current = get_int();
}
/* Issue a non-specific end of interrupt command (EOI) to the
interrupt controller. This rearms it for the next shot.
*/
outportb(0xa0,0x20);
outportb(0x20,0x20);
}
/* Mask IRQ 10 */
/* Put back the old interrupt handler */
/* Do non-specific EOI */

Advertisement

Table of Contents
loading

Table of Contents