WinSystems EBC-LP Operation Manual page 85

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

Advertisement

/* INTS.C
Copyright 1996-2001 by WinSystems Inc.
Permission is hereby granted to the purchaser of the WinSystems
UIO cards and CPU products incorporating the UIO device, to distribute
any binary file or files compiled using this source code directly or
in any work derived by the user from this file. In no case may the
source code, original or derived from this file, be distributed to any
third party except by explicit permission of WinSystems. This file is
distributed on an "As-is" basis and no warranty as to performance,
fitness of purposes, or any other warranty is expressed or implied.
In no case shall WinSystems be liable for any direct or indirect loss
or damage, real or consequential resulting from the usage of this
source code. It is the user's sole responsibility to determine
fitness for any considered purpose.
*/
#include <stdio.h>
#include <dos.h>
#include <conio.h>
#include "uio48.h"
#define BASE_PORT 0x120
/* This program like the poll.c sample uses the edge detection interrupt
capability of the WS16C48 to count edge transitions. Unlike poll.c,
however this program actually uses interrupts and update all of the
transition counters in the background.
*/
/* Our transition totals are stored in this global array */
unsigned int_counts[25];
/* Function declarations for local functions */
void check_ints(void);
void interrupt int_handler(void);
void interrupt (*old_handler)(void);
void main()
{
int x;
/* Initialize the I/O ports. Set all I/O pins to input */
init_io(BASE_PORT);
/* Install an interrupt handler for the board */
/* We disable interrupts whenever we're changing the environment */
disable();
/* Get the old handler and save it for later resoration */
/* Disable interrupts during initialization */

Advertisement

Table of Contents
loading

Table of Contents