summaryrefslogtreecommitdiff
path: root/gpib.c
diff options
context:
space:
mode:
authorMichael J. Chudobiak <mjc@avtechpulse.com>2012-12-07 09:31:34 -0500
committerMichael J. Chudobiak <mjc@avtechpulse.com>2012-12-07 09:31:34 -0500
commit1d5a0d1ea87880bf367a7ac56f7cda59297f36a3 (patch)
tree98f21fd76480c54240368b228d1db2067b06485f /gpib.c
parentb0dd33d5f68fa172fd29bdd7e4426f632e801f88 (diff)
fixed gpib comment formatting
Diffstat (limited to 'gpib.c')
-rw-r--r--gpib.c311
1 files changed, 164 insertions, 147 deletions
diff --git a/gpib.c b/gpib.c
index 4a29333..6007cdf 100644
--- a/gpib.c
+++ b/gpib.c
@@ -78,9 +78,9 @@
* Define TNT register map and TL related bits and functions
*
* FORMAT:
- * register address
- * B_bits value
- * F_function value (F_field)
+ * register address
+ * B_bits value
+ * F_function value (F_field)
*
****************************************************************************/
@@ -231,9 +231,9 @@
/* TNT4882 GLOBAL VARIABLES -------------------------------------------------*/
-int INTERFACE_ERROR; /* Error Code */
-int INTERFACE_STATUS; /* Interface Status */
-unsigned char MR_4882_status[5]; /* 4882 status memory registers */
+int INTERFACE_ERROR; /* Error Code */
+int INTERFACE_STATUS; /* Interface Status */
+unsigned char MR_4882_status[5]; /* 4882 status memory registers */
unsigned long int DATA_COUNT; /* Transfer count */
unsigned long int Requested_Count; /* Requested transfer count */
@@ -260,61 +260,61 @@ void TNT_4882_Status(int status_register,unsigned int byte,int operation)
{
int set_srq;
- MR_4882_status[STB] = TNT_In(R_spsr); /* Get STB */
+ MR_4882_status[STB] = TNT_In(R_spsr); // Get STB
switch (operation) {
case SET:
- /* Cannot set SRQ directly */
+ // Cannot set SRQ directly
if((status_register==STB)||(status_register==SRE)) {
byte&=~0x40;
}
- MR_4882_status[status_register]|= byte;/* OR in new register value */
+ MR_4882_status[status_register]|= byte; // OR in new register value
if(status_register==IST) {
- TNT_Out(R_auxmr,F_ist1); /* if IST set IST bit */
+ TNT_Out(R_auxmr,F_ist1); // if IST set IST bit
}
break;
case CLEAR:
- MR_4882_status[status_register]&=~byte; /* ~AND requested bits */
+ MR_4882_status[status_register]&=~byte; // ~AND requested bits
if(status_register==IST) {
- TNT_Out(R_auxmr,F_ist0); /* if IST clear IST bit */
+ TNT_Out(R_auxmr,F_ist0); // if IST clear IST bit
}
break;
default:
- TNT_Gen_Error(EARG); /* Neither SET/CLEAR then EARG */
+ TNT_Gen_Error(EARG); // Neither SET/CLEAR then EARG
break;
}
- /* If ESE&ESR set ESB bit */
+ // If ESE&ESR set ESB bit
MR_4882_status[STB]|=(MR_4882_status[ESE]&MR_4882_status[ESR])? 0x20 : 0;
- /* If STB&SRE set RQS bit */
+ // If STB&SRE set RQS bit
set_srq = (MR_4882_status[STB]&MR_4882_status[SRE])? TRUE : FALSE;
- if(set_srq) { /* If SRQ desired */
- TNT_Out(R_auxmr,F_reqt); /* Set request true */
- } else { /* Else */
- TNT_Out(R_auxmr,F_reqf); /* Set request false */
+ if(set_srq) { // If SRQ desired
+ TNT_Out(R_auxmr,F_reqt); // Set request true
+ } else {
+ TNT_Out(R_auxmr,F_reqf); // Set request false
}
- TNT_Out(R_spmr,MR_4882_status[STB]); /* Set new serial poll byte */
+ TNT_Out(R_spmr,MR_4882_status[STB]); // Set new serial poll byte
}
/****************************************************************************
*
* TNT_INT_STATUS(): Used to update INTERFACE_STATUS word by reading
- * R_isr0,R_isr1,R_isr2,R_isr3,R_adsr,R_spmr and
- * updating the appropriate INTERFACE_STATUS bits.
+ * R_isr0,R_isr1,R_isr2,R_isr3,R_adsr,R_spmr and
+ * updating the appropriate INTERFACE_STATUS bits.
*
* INTERFACE_STATUS bits:
*
- * ERR (1<<15) Error - Check INTERFACE_ERROR for error
- * TIMO (1<<14) Timeout - If timeouts are used
- * END (1<<13) End/EOI/EOS - End of transmition received
+ * ERR (1<<15) Error - Check INTERFACE_ERROR for error
+ * TIMO (1<<14) Timeout - If timeouts are used
+ * END (1<<13) End/EOI/EOS - End of transmition received
* EOS (1<<12) End of String - End of string received
* RQS (1<<11) Requesting Service - TNT asserting SRQ line
* IFC (1<<10) Interface Clear - Interface Clear Asserted
@@ -324,7 +324,7 @@ void TNT_4882_Status(int status_register,unsigned int byte,int operation)
* LOK (1<<7) Local Lockout - Lockout front panel controls
* REM (1<<6) Remote Programming - TNT in remote programming state
* ASYNC (1<<5) Asyncronous I/O - NOT USED IN NON-INT ESP
- * DTAS (1<<4) Trigger Active State - Requested Device Trigger
+ * DTAS (1<<4) Trigger Active State - Requested Device Trigger
* DCAS (1<<3) Clear Active State - Requested Device Clear
* LACS (1<<2) Listener Active - TNT listen addressed
* TACS (1<<1) Talker Active - TNT talk addressed
@@ -345,11 +345,10 @@ static int TNT_INT_STATUS(void)
mr_adsr=TNT_In(R_adsr); /* Read status register adsr */
INTERFACE_STATUS&=(UCMPL|END|EOS|TIMO|ERR); /* Maintain I/O bits */
- /* These are cleared at the */
- /* beginning of a new I/O call */
+ // These are cleared at the beginning of a new I/O call
- /* Get new status */
- INTERFACE_STATUS|=((mr_isr0&B_to) ?TIMO :0)|((mr_isr2&B_rem) ?REM :0)
+ // Get new status
+ INTERFACE_STATUS|= ((mr_isr0&B_to) ?TIMO :0)|((mr_isr2&B_rem) ?REM :0)
|((mr_isr1&B_end) ?END :0)|((mr_isr0&B_eos) ?EOS :0)
|((mr_spsr&B_pend)?RQS :0)|((mr_isr0&B_ifc) ?IFC :0)
|((mr_isr0&B_stbo)?SPOLL:0)|((mr_isr2&B_lok) ?LOK :0)
@@ -358,14 +357,14 @@ static int TNT_INT_STATUS(void)
INTERFACE_STATUS|=((INTERFACE_STATUS&(LACS|TACS)) ? 0:NACS);
- return INTERFACE_STATUS; /* Return status */
+ return INTERFACE_STATUS;
}
/****************************************************************************
*
* TNT_Gen_Error(): Used to Update INTERFACE_ERROR. INTERFACE_ERROR is
- * only valid when ERR is set in INTERFACE_STATUS.
+ * only valid when ERR is set in INTERFACE_STATUS.
*
* INTERFACE_ERROR values:
*
@@ -393,12 +392,12 @@ static void TNT_Gen_Error(int code)
/**************************** INITIALIZATION ********************************
*
* GPIB_initialize(): Sets the TNT into a known initialized state,
- * clears global values (mask registers,status words),
- * and loads current addressing setup.
+ * clears global values (mask registers,status words),
+ * and loads current addressing setup.
*
- * Normally, this function is executed once at power
- * up, however it may be used to reinitialize the
- * interface during operation.
+ * Normally, this function is executed once at power
+ * up, however it may be used to reinitialize the
+ * interface during operation.
*
****************************************************************************/
@@ -481,59 +480,63 @@ void GPIB_change_address(int new_address)
static void TNT_Setup_IO(int IO_type, unsigned long int cnt, int term)
{
- unsigned long int twos_cnt; /* Obtain the twos compliment cnt */
+ unsigned long int twos_cnt; // Obtain the twos compliment cnt
twos_cnt=-cnt;
- Requested_Count=cnt; /* Save requested transfer cnt */
+ Requested_Count=cnt; // Save requested transfer cnt
- TNT_Out(R_cmdr,F_resetfifo); /* Reset TNT fifos */
+ TNT_Out(R_cmdr,F_resetfifo); // Reset TNT fifos
- TNT_Out(R_cnt0, (char)(twos_cnt)); /* Load twos compliment count */
- TNT_Out(R_cnt1, (char)(twos_cnt>>8)); /* into TNT count registers */
+ TNT_Out(R_cnt0, (char)(twos_cnt)); // Load twos compliment count
+ TNT_Out(R_cnt1, (char)(twos_cnt>>8)); // into TNT count registers
TNT_Out(R_cnt2, (char)(twos_cnt>>16));
TNT_Out(R_cnt3, (char)(twos_cnt>>24));
- TNT_Out(R_imr0,B_glint); /* Set write to imr0 to be sure */
- TNT_Out(R_auxmr,HR_auxrj|0); /* B_to is cleared */
+ TNT_Out(R_imr0,B_glint); // Set write to imr0 to be sure
+ TNT_Out(R_auxmr,HR_auxrj|0); // B_to is cleared
switch(IO_type) {
case INPUT_BYTE:
- TNT_Out(R_imr1, B_end); /* End transfer on eoi or eos */
-
- TNT_Out(R_eosr, READ_EOS_BYTE); /* Set eos byte */
+ TNT_Out(R_imr1, B_end); // End transfer on eoi or eos
+ TNT_Out(R_eosr, READ_EOS_BYTE); // Set eos byte
TNT_Out(R_auxmr,HR_auxra|F_hlde|((term&EOS)?B_endoneos:0));
- /* Configure for byte input */
+
+ // Configure for byte input
TNT_Out(R_cfg , F_input_config&~B_16bit);
- /* Holdoff on end & enable eos */
- TNT_Out(R_auxmr,F_rhdf); /* Release holdoff */
- TNT_Out(R_cmdr, F_go); /* Start transfer state machine */
+
+ // Holdoff on end & enable eos
+ TNT_Out(R_auxmr,F_rhdf); // Release holdoff
+ TNT_Out(R_cmdr, F_go); // Start transfer state machine
break;
case INPUT:
- TNT_Out(R_imr1, B_end); /* End transfer on eoi or eos */
- TNT_Out(R_eosr, READ_EOS_BYTE); /* Set eos byte */
+ TNT_Out(R_imr1, B_end); // End transfer on eoi or eos
+ TNT_Out(R_eosr, READ_EOS_BYTE); // Set eos byte
TNT_Out(R_auxmr,HR_auxra|F_hlde|((term&EOS)?B_endoneos:0));
- TNT_Out(R_cfg , F_input_config); /* Configure for *byte* input */
+ TNT_Out(R_cfg , F_input_config); // Configure for *byte* input
+
/* Holdoff on end & enable eos */
- TNT_Out(R_auxmr,F_rhdf); /* Release holdoff */
- TNT_Out(R_cmdr, F_go); /* Start transfer state machine */
+ TNT_Out(R_auxmr,F_rhdf); // Release holdoff
+ TNT_Out(R_cmdr, F_go); // Start transfer state machine
break;
case OUTPUT:
- TNT_Out(R_imr1, B_err); /* End transfer on err */
- TNT_Out(R_eosr, WRITE_EOS_BYTE); /* Set EOS byte */
- /* Holdoff on all & enable EOS */
+ TNT_Out(R_imr1, B_err); // End transfer on err
+ TNT_Out(R_eosr, WRITE_EOS_BYTE); // Set EOS byte
+
+ // Holdoff on all & enable EOS
TNT_Out(R_auxmr,HR_auxra|F_hlda|((term&EOS)?B_xeoiweos:0));
- /* Configure for *byte* output */
+
+ // Configure for *byte* output
TNT_Out(R_cfg , F_output_config|((term)?B_ccen:0));
- TNT_Out(R_auxmr,F_hldi); /* Hold off immediately */
- TNT_Out(R_cmdr, F_go); /* Start transfer state machine */
+ TNT_Out(R_auxmr,F_hldi); // Hold off immediately
+ TNT_Out(R_cmdr, F_go); // Start transfer state machine
break;
default:
- TNT_Gen_Error(EARG); /* If IO_type incorrect issue EARG*/
+ TNT_Gen_Error(EARG); // If IO_type incorrect issue EARG
break;
}
}
@@ -541,24 +544,24 @@ static void TNT_Setup_IO(int IO_type, unsigned long int cnt, int term)
static void TNT_DONE_Handler(int IO_type,unsigned long int *count_sent)
{
- TNT_Out(R_cmdr,F_stop); /* Stop fifos */
- TNT_Out(R_cmdr,F_resetfifo); /* Reset the fifos */
+ TNT_Out(R_cmdr,F_stop); // Stop fifos
+ TNT_Out(R_cmdr,F_resetfifo); // Reset the fifos
- if(TNT_In(R_isr1)&B_end) { /* If we received an END */
- TNT_Out(R_auxmr,F_clrEND); /* Clear status bit */
+ if(TNT_In(R_isr1)&B_end) { // If we received an END
+ TNT_Out(R_auxmr,F_clrEND); // Clear status bit
}
if(TNT_In(R_isr1)&B_err) {
- TNT_Gen_Error(ENOL); /* No listeners */
- TNT_Out(R_auxmr,F_clrERR); /* Clear error bit */
+ TNT_Gen_Error(ENOL); // No listeners
+ TNT_Out(R_auxmr,F_clrERR); // Clear error bit
if(IO_type==OUTPUT) {
- TNT_Out(R_hssel,F_onechip|B_go2sids); /* if error set to idle state. */
+ TNT_Out(R_hssel,F_onechip|B_go2sids); // if error set to idle state.
TNT_Out(R_hssel,F_onechip);
}
}
- *count_sent = TNT_DATA_COUNT(); /* Obtain transfer count */
+ *count_sent = TNT_DATA_COUNT(); // Obtain transfer count
}
@@ -590,14 +593,14 @@ static unsigned char TNT_In(int reg)
static int TNT_input_bav(void)
{
- /* is a byte available (bav) in the TNT4882 FIFOs? Used mostly for GPIB reads */
+ // is a byte available (bav) in the TNT4882 FIFOs? Used mostly for GPIB reads
return (int) TNT_In(R_isr3)&B_nef;
}
static int TNT_update_brq(void)
{
- /* is the GPIB requesting data from the TNT4882? */
+ // is the GPIB requesting data from the TNT4882?
int state_SGNS;
int state_TACS;
@@ -608,7 +611,7 @@ static int TNT_update_brq(void)
each data request, so some memory is required to avoid generating multiple,
stateless brq messages. */
- if (!prev_brq) { /* prev_brq=0 */
+ if (!prev_brq) {
prev_brq=state_SGNS;
return state_SGNS;
} else {
@@ -645,20 +648,26 @@ int GPIB_check_for_messages(char *gpib_buf)
return FALSE;
}
- /* If the GPIB has requested data, and no output messages are in the TNT4882 FIFOs, generate a query error */
+ // If the GPIB has requested data, and no output messages
+ // are in the TNT4882 FIFOs, generate a query error
+
if (TNT_update_brq() && !TNT_input_bav() && ib_empty) {
queue_error_for_gpib_only(query_error_unterminated);
}
- /* If the TNT4882 is talk addressed, the controller must be still reading output data in the TNT4882
- FIFOs. Wait until this process has completed and the TNT4882 is listen addressed. */
+ // If the TNT4882 is talk addressed, the controller must
+ // be still reading output data in the TNT4882 FIFOs.
+ // Wait until this process has completed and the TNT4882
+ // is listen addressed.
+
if ( (TNT_In(R_adsr)&B_ta) && (TNT_In(R_isr3)&B_nef) && !(TNT_In(R_cfg)&B_in)) {
- return OK; /* exit if not listen addressed */
+ // exit if not listen addressed
+ return OK;
}
-
- /* if no I/O is begin done, set up for input. Note that TLCHLTE must be set to zero, so that the */
- /* HALT signal is set only by the STOP and GO commands. */
+ // if no I/O is begin done, set up for input. Note that TLCHLTE
+ // must be set to zero, so that the HALT signal is set only by
+ // the STOP and GO commands.
if (TNT_In(R_sts1)&B_halt) {
cnt=max_gpib_input_length-8;
gpib_buf[0]=0;
@@ -666,7 +675,7 @@ int GPIB_check_for_messages(char *gpib_buf)
TNT_Setup_IO(INPUT,cnt,EOI|EOS);
}
- /* is data available to read? */
+ // is data available to read?
return (TNT_In(R_isr3)&B_nef) && (TNT_In(R_cfg)&B_in);
}
@@ -677,26 +686,27 @@ int GPIB_handle_new_input(char *gpib_buf)
return FALSE;
}
- /* read until done or buffers empty. Then reset DAC holdoff */
+ // read until done or buffers empty. Then reset DAC holdoff
- unsigned long int count_sent; /* Local count variable */
+ unsigned long int count_sent; // Local count variable
int i;
char *buffer_pos;
buffer_pos = gpib_buf;
- count_sent=0; /* Clear I/O status bits */
- DATA_COUNT=0; /* Clear count global */
+ count_sent=0; // Clear I/O status bits
+ DATA_COUNT=0; // Clear count global
- /* read FIFOs until transaction completed or interrupted */
- while( !( INTERFACE_STATUS & DCAS) /* device clear */
- && !( !TNT_input_bav() && (INTERFACE_STATUS & END)) /* proper transaction end */
- && !( !TNT_input_bav() && TNT_In(R_isr3)&B_done) /* proper transaction end */
- && !( !TNT_input_bav() && (INTERFACE_STATUS & TIMO)) /* improper timeout */
- && !( !TNT_input_bav() && TNT_update_brq() && ib_empty) /* brq message true, GPIB requesting data */
+ // read FIFOs until transaction completed or interrupted
+ while( !( INTERFACE_STATUS & DCAS) // device clear
+ && !( !TNT_input_bav() && (INTERFACE_STATUS & END)) // proper transaction end
+ && !( !TNT_input_bav() && TNT_In(R_isr3)&B_done) // proper transaction end
+ && !( !TNT_input_bav() && (INTERFACE_STATUS & TIMO)) // improper timeout
+ && !( !TNT_input_bav() && TNT_update_brq() && ib_empty) // brq message true,
+ // GPIB requesting data
) {
- /* choose the most efficient fifo-emptying method based on FIFO flags */
+ // choose the most efficient fifo-emptying method based on FIFO flags
switch(TNT_In(R_isr3)&(B_nff|B_intsrc2|B_nef)) {
case (B_nef):
case (B_nef|B_intsrc2):
@@ -716,28 +726,29 @@ int GPIB_handle_new_input(char *gpib_buf)
break;
}
- TNT_INT_STATUS(); /* Update to get current status */
+ TNT_INT_STATUS(); // Update to get current status
}
- TNT_DONE_Handler(INPUT,&count_sent); /* Finish up and get count */
- DATA_COUNT+=count_sent; /* Update total transfer count */
- cnt-=count_sent; /* Update total requested count */
- buffer_pos=buffer_pos+((int) count_sent); /* Update buffer pointer */
+ TNT_DONE_Handler(INPUT,&count_sent); // Finish up and get count
+ DATA_COUNT+=count_sent; // Update total transfer count
+ cnt-=count_sent; // Update total requested count
+ buffer_pos=buffer_pos+((int) count_sent); // Update buffer pointer
- INTERFACE_STATUS|=UCMPL; /* Set the user complete bit */
+ INTERFACE_STATUS|=UCMPL; // Set the user complete bit
if (GPIB_check_for_device_clear_signal()) {
- return FALSE; /* abandon if SDC, DCL */
+ return FALSE; // abandon if SDC, DCL
}
if (TNT_update_brq() && !TNT_input_bav() && ib_empty)
- /* abandon if brq with no commands to process */
+ // abandon if brq with no commands to process
{
queue_error_for_gpib_only(query_error_unterminated);
- prev_brq=1; /* reset brq */
- TNT_update_brq(); /* update it so that it doesn't get confused in idle state */
+ prev_brq=1; // reset brq
+ TNT_update_brq(); // update it so that it doesn't get confused
+ // in idle state
return FALSE;
}
@@ -748,14 +759,14 @@ int GPIB_handle_new_input(char *gpib_buf)
static void TNT_RFD_Holdoff()
{
- /* holdoff accepting data until software has checked the state of the TNT4882 */
- TNT_Out(R_auxmr,F_hldi); /* set immediate RFD holdoff */
+ // holdoff accepting data until software has checked the state of the TNT4882
+ TNT_Out(R_auxmr,F_hldi); // set immediate RFD holdoff
}
static void TNT_Holdoff_off()
{
- TNT_Out(R_auxmr,F_rhdf); /* cancel immediate RFD holdoff */
+ TNT_Out(R_auxmr,F_rhdf); // cancel immediate RFD holdoff
}
@@ -768,7 +779,8 @@ int GPIB_send_query_response(gpointer *ignore_this, char *in_string)
return OK;
}
- if (GPIB_response_already_pending()) { /* if MAV already, data will be lost. Set QYE bit in STB. */
+ if (GPIB_response_already_pending()) {
+ // if MAV already, data will be lost. Set QYE bit in STB.
queue_error_for_gpib_only(query_error_interrupted);
}
@@ -778,25 +790,26 @@ int GPIB_send_query_response(gpointer *ignore_this, char *in_string)
// just a pointer
char *out_buffer = term_string;
- /* message must be available if this function has been called */
+ // message must be available if this function has been called
unsigned long int out_cnt;
- unsigned long int count_sent; /* Local count variable */
+ unsigned long int count_sent; // Local count variable
int i;
out_cnt = strlen (out_buffer);
- TNT_4882_Status(STB,0x10,SET); /* Set MAV bit */
+ TNT_4882_Status(STB,0x10,SET); // Set MAV bit
TNT_INT_STATUS();
- /* if the TNT4882 isn't talk addressed, wait until it is, or until the GPIB sends a clear signal,
- or until the GPIB writes more data to the TNT4882, generating a query error. */
+ // if the TNT4882 isn't talk addressed, wait until it is, or until the GPIB sends a clear signal,
+ // or until the GPIB writes more data to the TNT4882, generating a query error.
+
while (!(INTERFACE_STATUS&TACS)) {
TNT_RFD_Holdoff();
if (INTERFACE_STATUS&DCAS) {
- /* device has been cleared. return to idle state */
- TNT_4882_Status(STB,0x10,CLEAR); /* Clear MAV bit */
+ //* device has been cleared. return to idle state
+ TNT_4882_Status(STB,0x10,CLEAR); // Clear MAV bit
TNT_Holdoff_off();
/* added by MJC - June 20/06 */
@@ -806,17 +819,19 @@ int GPIB_send_query_response(gpointer *ignore_this, char *in_string)
return OK;
} else if (!TNT_input_bav()) {
- /* if no bytes are available, we're still waiting for the GPIB to request data. Repeat loop. */
+ // if no bytes are available, we're still waiting for the
+ // GPIB to request data. Repeat loop.
TNT_Setup_IO(INPUT,out_cnt,EOI|EOS);
TNT_INT_STATUS();
TNT_Holdoff_off();
} else {
- /* abandon if input bytes available, and generate query error */
+ // abandon if input bytes available, and generate query error
TNT_Holdoff_off();
queue_error_for_gpib_only(query_error_interrupted);
- TNT_4882_Status(STB,0x10,CLEAR); /* Clear MAV bit */
- prev_brq=1; /* reset brq */
- TNT_update_brq(); /* update it so that it doesn't get confused in idle state */
+ TNT_4882_Status(STB,0x10,CLEAR); // Clear MAV bit
+ prev_brq=1; // reset brq
+ TNT_update_brq(); // update it so that it doesn't get
+ // confused in idle state
return OK;
}
}
@@ -824,76 +839,78 @@ int GPIB_send_query_response(gpointer *ignore_this, char *in_string)
TNT_Setup_IO(OUTPUT,out_cnt,EOI|EOS);
count_sent=0;
- INTERFACE_STATUS=0; /* Clear I/O status bits */
- DATA_COUNT=0; /* Clear count global */
+ INTERFACE_STATUS=0; // Clear I/O status bits
+ DATA_COUNT=0; // Clear count global
if(out_cnt==0) {
INTERFACE_STATUS|=UCMPL;
return OK;
}
- /* send data until completed or interrupted */
+ // send data until completed or interrupted
while( !(INTERFACE_STATUS&(DCAS|TIMO|END|ERR|LACS))
&& !(TNT_In(R_isr3)&B_done)
) {
- /* choose the most efficient fifo-filling method based on flags */
+ // choose the most efficient fifo-filling method based on flags
switch(TNT_In(R_isr3)&(B_nff|B_intsrc2|B_nef)) {
case (B_nff):
- case (B_nff|B_intsrc2): /* 16 words in fifo are empty */
+ case (B_nff|B_intsrc2): // 16 words in fifo are empty
for(i=0; i<16; i++) {
TNT_Out(R_fifob,*((char *)(out_buffer++)));
}
break;
- case (B_nff|B_intsrc2|B_nef): /* 8 words in fifo are empty */
+ case (B_nff|B_intsrc2|B_nef): // 8 words in fifo are empty
for(i=0; i<8; i++) {
TNT_Out(R_fifob,*((char *)(out_buffer++)));
}
break;
- case (B_nff|B_nef): /* 1 word in fifo is empty */
+ case (B_nff|B_nef): // 1 word in fifo is empty
TNT_Out(R_fifob,*((char *)(out_buffer++)));
break;
}
- TNT_INT_STATUS(); /* Get current status */
+ TNT_INT_STATUS(); // Get current status
}
- TNT_DONE_Handler(OUTPUT,&count_sent); /* Finish up and get count */
- DATA_COUNT+=count_sent; /* Update total transfer count */
- out_cnt-=count_sent; /* Update total requested count */
- out_buffer=out_buffer+((int) count_sent); /* Update buffer pointer */
+ TNT_DONE_Handler(OUTPUT,&count_sent); // Finish up and get count
+ DATA_COUNT+=count_sent; // Update total transfer count
+ out_cnt-=count_sent; // Update total requested count
+ out_buffer=out_buffer+((int) count_sent); // Update buffer pointer
- INTERFACE_STATUS|=UCMPL; /* Set the user complete bit */
+ INTERFACE_STATUS|=UCMPL; // Set the user complete bit
g_free (term_string);
if (INTERFACE_STATUS&DCAS) {
- TNT_4882_Status(STB,0x10,CLEAR); /* Clear MAV bit */
+ TNT_4882_Status(STB,0x10,CLEAR); // Clear MAV bit
- /* added by MJC - June 20/06 */
- /* reset interface if a device clear is received */
+ // added by MJC - June 20/06
+ // reset interface if a device clear is received
TNT_Out(R_auxmr,F_clrDEC);
TNT_INT_STATUS();
- return OK; /* abandon if SDC or DCL */
+ return OK; // abandon if SDC or DCL
}
if ((INTERFACE_STATUS&LACS) && (TNT_In(R_isr3)&B_nef)) {
- /* abandon gracefully if listen-addressed with data in buffer */
+ // abandon gracefully if listen-addressed with data in buffer
queue_error_for_gpib_only(query_error_interrupted);
- TNT_4882_Status(STB,0x10,CLEAR); /* Clear MAV bit */
- prev_brq=1; /* reset brq */
- TNT_update_brq(); /* update it so that it doesn't get confused in idle state */
+ TNT_4882_Status(STB,0x10,CLEAR); // Clear MAV bit
+ prev_brq=1; // reset brq
+ TNT_update_brq(); // update it so that it doesn't get
+ // confused in idle state
TNT_Setup_IO(INPUT,cnt,EOI|EOS);
return OK;
}
if(DATA_COUNT>0) {
- TNT_4882_Status(STB,0x10,CLEAR); /* Clear MAV bit */
- prev_brq=1; /* brq was active during send */
- TNT_update_brq(); /* update it so that it doesn't get confused in idle state */
+ TNT_4882_Status(STB,0x10,CLEAR); // Clear MAV bit
+ prev_brq=1; // brq was active during send */
+ TNT_update_brq(); // update it so that it doesn't get
+ // confused in idle state
}
return OK;
@@ -907,7 +924,7 @@ void GPIB_check_remote_status (int *is_remote, int *is_lockout)
return;
}
- TNT_INT_STATUS(); /* Update to get current status */
+ TNT_INT_STATUS(); // Update to get current status
if ((INTERFACE_STATUS&REM) == REM) {
*is_remote = 1;
}
@@ -935,7 +952,7 @@ void GPIB_go_to_local ()
return;
}
- TNT_Out(R_auxmr,0x05); /* issue TNT rtl command */
+ TNT_Out(R_auxmr,0x05); // issue TNT rtl command
return;
}
@@ -946,8 +963,8 @@ void GPIB_clear_events ()
return;
}
- TNT_4882_Status(ESR,0xff,CLEAR); /* Clear ESR register */
- TNT_4882_Status(STB,0x20,CLEAR); /* Clear ESB bit in STB */
+ TNT_4882_Status(ESR,0xff,CLEAR); // Clear ESR register
+ TNT_4882_Status(STB,0x20,CLEAR); // Clear ESB bit in STB
return;
}