void interrupt int_char_in(void)
{
enable();
/* Enable hardware interrupts */
if(int_buf_count < INT_BUF_size) {
*int+ = inportb(RDR); /* Read byte from UART */
int_bu+;
if(int_buf_in >= i INT_BUF_size) int_buf_in = int_buf;
int_buf_ovfl = 0;
}
else {
inportb(RDR);
/* Clear UART interrupt */
int_buf_ovfl = 1;
}
outportb(INT_controller,End_of_interrupt); /* Non-specific EOI */
}
void send_ctlc(void)
{
outportb(MCR,0x8);
/* De-assert DTR */
delay(10);
/* Wait 10 mS for stray characters */
while(!(inportb(LSR) & 0x20)) ; /* Wait on transmitter register */
outportb(THR,0x3);
/* Send ^C */
while(!(inportb(LSR) & 0x40)) ; /* Wait for ^C to be sent */
int_buf_in = int_buf_out = int_buf;
/* Clear int_char_in buffer */
int_buf_count = int_buf_ovfl = 0;
delay(20);
/* 20mS for HP 34401 to clean up */
outportb(MCR,0x9);
/* Assert DTR */
}
RS-232 Operation Using Turbo C
(continued)
Chapter 6 Application Programs
RS-232 Operation Using Turbo C
196
Summary of Contents for 34401A
Page 12: ...1 Quick Start 1 ...
Page 26: ...2 Front Panel Menu Operation 2 ...
Page 50: ...3 Features and Functions 3 ...
Page 103: ...4 Remote Interface Reference 4 ...
Page 135: ...SCPI Status System 4 Chapter 4 Remote Interface Reference The SCPI Status Model 135 ...
Page 170: ...5 Error Messages 5 ...
Page 182: ...6 Application Programs 6 ...
Page 196: ...7 Measurement Tutorial 7 ...
Page 214: ...8 Specifications 8 ...