summaryrefslogtreecommitdiff
path: root/instr-daemon.c
diff options
context:
space:
mode:
authorMichael J. Chudobiak <mjc@avtechpulse.com>2012-12-07 10:01:40 -0500
committerMichael J. Chudobiak <mjc@avtechpulse.com>2012-12-07 10:01:40 -0500
commit0140955d5e80254a03c9b3ce8b3046b162f65f2f (patch)
tree9958c1a81c38b6171837f43540b5c1a8c1932de6 /instr-daemon.c
parent1d5a0d1ea87880bf367a7ac56f7cda59297f36a3 (diff)
added GPIB/VXI locking skeleton
Diffstat (limited to 'instr-daemon.c')
-rw-r--r--instr-daemon.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/instr-daemon.c b/instr-daemon.c
index ec70f97..2097a6c 100644
--- a/instr-daemon.c
+++ b/instr-daemon.c
@@ -403,13 +403,26 @@ static gboolean periodic_poll (void)
Update_Main_Menu_If_Visible();
- GPIB_check_for_device_clear_signal();
- if (GPIB_check_for_messages(globals.Registers.gpib_buffer)) {
- if (GPIB_handle_new_input(globals.Registers.gpib_buffer)) {
- Parser_main(globals.Registers.gpib_buffer, 0, GPIB_send_query_response, NULL);
+ // don't check GPIB interface if a VXI interface is locked,
+ // or is currently handling a command
+
+ if ((globals.4882Locks.locked_network_server == NO_SERVER_LOCKED) &&
+ (globals.4882Locks.command_in_progress == FALSE)) {
+
+ // tell VXI servers that the 4882 subsystem is busy
+ globals.4882Locks.command_in_progress = TRUE;
+
+ GPIB_check_for_device_clear_signal();
+ if (GPIB_check_for_messages(globals.Registers.gpib_buffer)) {
+ if (GPIB_handle_new_input(globals.Registers.gpib_buffer)) {
+ Parser_main(globals.Registers.gpib_buffer, 0, GPIB_send_query_response, NULL);
+ }
}
+ GPIB_check_for_device_clear_signal();
+
+ // tell VXI servers that the 4882 subsystem is avilable again
+ globals.4882Locks.command_in_progress = FALSE;
}
- GPIB_check_for_device_clear_signal();
Update_Main_Menu_If_Visible();
}