WinSystems EBC-LP Operation Manual page 80

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

Advertisement

}
/*==========================================================================
*
*
*
*
This function take no arguments.
*
*
return value : The value returned is the highest level bit interrupt
*
*
*
This function returns the highest level interrupt pending. If no interrupt
*
is pending, a zero is returned. This function does NOT clear the interrupt.
*
*===========================================================================*/
int get_int(void)
{
int temp;
int x;
/* read the master interrupt pending register, mask off undefined bits */
temp = inportb(base_port+6) & 0x07;
/* If there are no interrupts pending, return a 0 */
if((temp & 7) == 0)
return(0);
/* There is something pending, now we need to identify what it is */
/* Set access to page 3 for interrupt id registers */
outportb(base_port+7,0xc0);
/* Read interrupt ID register for port 0 */
temp = inportb(base_port+8);
/* See if any bit set, if so return the bit number */
if(temp !=0)
{
for(x=0; x <=7; x++)
{
int */
}
}
/* None in Port 0, read port 1 interrupt ID register */
GET_INT
currently pending. Range is 1 to 24.
if(temp & (1 << x))
{
outportb(base_port+7,0);
return(x+1);
}
/* Turn off access */
/* Return bitnumber with active

Advertisement

Table of Contents
loading

Table of Contents