WinSystems EBC-LP Operation Manual page 86

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

Advertisement

old_handler = getvect(0x72);
/* Install out new interrupt handler */
setvect(0x72,int_handler);
/* Clear the transition count values and enable the falling edge
interrupts.
*/
for(x=1; x<25; x++)
{
int_counts[x] = 0;
enab_int(x,FALLING);
}
/* Unmask the interrupt controller */
outportb(0xa1,(inportb(0xa1) & 0xfb));
/* Reenable interrupts */
enable();
/* Set up the display */
clrscr();
/* Clear the Text Screen */
for(x=1; x<25; x++)
{
gotoxy(1,x);
printf("Bit Number %02d
}
/* We will continuously print the transition totals until a
key is pressed */
/* All of the processing of the transition interrupts, including
updating the counts is done in the background when an interrupt
occurs.
*/
while(!kbhit())
{
for(x=1; x < 25; x++)
{
gotoxy(16,x);
printf("%05u",int_counts[x]);
}
}
getch();
/* Disable interrupts while we restore things */
disable();
/* Mask off the interrupt at the interrupt controller */
/* Hardwired for IRQ10 */
/* Clear the counts */
/* Enable the falling edge interrupts */
/* Unmask IRQ 10 */
",x);

Advertisement

Table of Contents
loading

Table of Contents