}
/*==========================================================================
*
* GET_INT
*
* This function take no arguments.
*
* return value : The value returned is the highest level bit interrupt
* currently pending. Range is 1 to 24.
*
* 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(ba6) & 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(ba7,0xc0);
/* Read interrupt ID register for port 0 */
temp = inportb(ba8);
/* See if any bit set, if so return the bit number */
if(temp !=0)
{
for(x=0; x <=7; x++)
{
if(temp & (1 << x))
{
outportb(ba7,0);
/* Turn off access */
return(x+1);
/* Return bitnumber with active
int */
}
}
}
/* None in Port 0, read port 1 interrupt ID register */
Summary of Contents for EBC-LP
Page 68: ...APPENDIX C Mechanical Drawing...
Page 69: ......
Page 70: ......
Page 71: ...APPENDIX D WS16C48 I O Routines and Sample Program Listings...