WinSystems EBC-LP Operation Manual page 84

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

Advertisement

}
/* Clean up the screen for our display. Nothing fancy */
clrscr();
for(x=1; x<25; x++)
{
gotoxy(1,x);
printf("Bit number %02d ",x);
}
/* We will continue to display until any key is pressed */
while(!kbhit())
{
/* Retrieve any pending transitions and update the counts */
check_ints();
/* Display the current count values */
for(x=1; x < 25; x++)
{
}
}
getch();
}
void check_ints()
{
int current;
/* Get the bit number of a pending transition interrupt */
current = get_int();
/* If it's 0 there are none pending */
if(current == 0)
return;
/* Clear and rearm this one so we can get it again */
clr_int(current);
/* Tally a transition for this bit */
++int_counts[current];
}
gotoxy(16,x);
printf("%05u",int_counts[x]);

Advertisement

Table of Contents
loading

Table of Contents