Programming Examples
Appendix B
B-30
temp = dp–>COS_link_address ;
dp–>COS_link_address = COS_ACKNOWLEDGE;
if (dp–>operating_status.cos_overrun) {
/**** When this bit is set, it indicates the host is unable
***** to keep up with COS interrupts, i.e., the system input
***** state is changing more rapidly than the host is able to
***** process. COS interrupts should be enabled only in
***** systems that have infrequent state changes.
****/
}
/**** The application programmer should write a routine that
***** services the COS. The handle_input_COS routine called
***** below is not one of the supplied examples.
****/
handle_input_COS (temp);
}
/*============================================================================
**
** Service the end-of-scan–list interrupt next, since it is also
** time-critical.
** 1) make sure it’s enabled
** 2) if so, see if we got an end–of–scan–list interrupt
** 3) if so, acknowledge it
**
=============================================================================*/
if (dp–>config_data.interrupt_after_each_scan
&& dp–>running_status.end_of_scan_list) {
/**** Acknowledge the end_of_scan_list interrupt ****/
dp–>running_status.end_of_scan_list = FALSE;
/**** The application programmer may want to write a routine that
***** services the I/O image tables whenever a end_of_scan_list
***** interrupt occurs. The designer should keep in mind that
***** links operating at a high baud rate and with short scan lists
***** are likely to cause frequent interrupts. The host should be
***** capable of handling these interrupts in a timely fashion.
****/
}
/*============================================================================
**
** Service the regular interrupt next, since it is queued
** 1) see what type it is
** 2) service by type...
**
=============================================================================*/
/**** dp–>int_status_to_host is the interrupt type ****/
switch (dp–>int_status_to_host) {
/**** Host ack’d last interrupt ****/
case NO_KTX_INT_AVAILABLE :
break;
/**** Initialization is complete ****/
case INIT_DONE_INTERRUPT :
/**** Check completion status ****/