summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gpib.c22
-rw-r--r--gpib.h2
-rw-r--r--vxi11_server.c1
3 files changed, 20 insertions, 5 deletions
diff --git a/gpib.c b/gpib.c
index 5d5fb74..3945447 100644
--- a/gpib.c
+++ b/gpib.c
@@ -648,7 +648,7 @@ int GPIB_check_for_device_clear_signal(void)
int GPIB_and_VXI_device_clear(void)
{
TNT_Out(R_auxmr,F_clrDEC);
- TNT_4882_Status(STB,0x10,CLEAR); // Clear MAV bit
+ GPIB_and_VXI_clear_MAV();
g_free (globals.Registers.pending_output_message);
globals.Registers.pending_output_message = NULL;
@@ -800,7 +800,7 @@ void GPIB_and_VXI_start_query_response(gpointer ignore_this, gchar *in_string)
}
globals.Registers.pending_output_message = g_strdup_printf ("%s\n", in_string);
- TNT_4882_Status(STB,0x10,SET); // Set MAV bit
+ GPIB_and_VXI_set_MAV();
}
@@ -842,7 +842,7 @@ void GPIB_finish_query_response()
// 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
+ GPIB_and_VXI_clear_MAV();
prev_brq=1; // reset brq
TNT_update_brq(); // update it so that it doesn't get
return; // confused in idle state
@@ -906,7 +906,7 @@ void GPIB_finish_query_response()
if ((INTERFACE_STATUS&LACS) && (TNT_In(R_isr3)&B_nef)) {
// 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
+ GPIB_and_VXI_clear_MAV();
prev_brq=1; // reset brq
TNT_update_brq(); // update it so that it doesn't get
// confused in idle state
@@ -915,7 +915,7 @@ void GPIB_finish_query_response()
}
if(DATA_COUNT>0) {
- TNT_4882_Status(STB,0x10,CLEAR); // Clear MAV bit
+ GPIB_and_VXI_clear_MAV();
prev_brq=1; // brq was active during send */
TNT_update_brq(); // update it so that it doesn't get
// confused in idle state
@@ -994,6 +994,18 @@ unsigned int GPIB_and_VXI_get_STB ()
}
+void GPIB_and_VXI_set_MAV()
+{
+ TNT_4882_Status(STB,0x10,SET);
+}
+
+
+void GPIB_and_VXI_clear_MAV()
+{
+ TNT_4882_Status(STB,0x10,CLEAR);
+}
+
+
void GPIB_set_ESR (unsigned int byte,int operation)
{
if (!globals.HWDetect.gpib) {
diff --git a/gpib.h b/gpib.h
index aba8081..f8884be 100644
--- a/gpib.h
+++ b/gpib.h
@@ -14,6 +14,8 @@ int GPIB_check_for_messages(char *gpib_buf);
int GPIB_handle_new_input(char *gpib_buf);
void GPIB_and_VXI_start_query_response(gpointer ignore_this, gchar *in_string);
void GPIB_finish_query_response();
+void GPIB_and_VXI_set_MAV();
+void GPIB_and_VXI_clear_MAV();
void GPIB_check_remote_status (int *is_remote, int *is_lockout);
void GPIB_go_to_local ();
void GPIB_clear_events ();
diff --git a/vxi11_server.c b/vxi11_server.c
index f367694..878f4aa 100644
--- a/vxi11_server.c
+++ b/vxi11_server.c
@@ -300,6 +300,7 @@ device_read_1_svc(Device_ReadParms *argp, struct svc_req *rqstp) {
result.data.data_len = strlen(globals.Registers.pending_output_message);
result.data.data_val = globals.Registers.pending_output_message;
globals.Registers.pending_output_message = NULL;
+ GPIB_and_VXI_clear_MAV();
#ifdef DEBUG
printf("sending ---%s---\n", result.data.data_val);
#endif