diff options
author | Michael J. Chudobiak <mjc@avtechpulse.com> | 2012-12-12 09:06:11 -0500 |
---|---|---|
committer | Michael J. Chudobiak <mjc@avtechpulse.com> | 2012-12-12 09:06:11 -0500 |
commit | e0a92714bbc15e1dce3dad66be9bbf29b93ac0cc (patch) | |
tree | 1955e7b1abf9e6e60a8925c0aacafa146a11a557 | |
parent | d4e6f5a091c4c8aee14abf48a099b7a579d73f07 (diff) |
further simplification of remote mode reporting
-rw-r--r-- | globals.h | 3 | ||||
-rw-r--r-- | menus.c | 22 |
2 files changed, 6 insertions, 19 deletions
@@ -776,7 +776,8 @@ typedef struct { int terminal_connections; int vxi_connections; int vxi_service_request; - int mode; + int gpib_remote; + int gpib_lock; } RemoteStruct; @@ -213,27 +213,13 @@ static void Nonstd_menu_network(void); static void Read_Keypad(int *button_port_val, int *upper_encoder_val, int *lower_encoder_val); -#define RM_NOT_LOCK 0 -#define RM_NOT_REM 0 -#define RM_LOCK 1 -#define RM_REM 2 - -#define GPIB_REMOTE_AND_UNLOCKED ((globals.Remote.mode & RM_REM) && !(globals.Remote.mode & RM_LOCK)) -#define GPIB_REMOTE_AND_LOCKED ((globals.Remote.mode & RM_REM) && (globals.Remote.mode & RM_LOCK)) +#define GPIB_REMOTE_AND_UNLOCKED (globals.Remote.gpib_remote && !globals.Remote.gpib_lock) +#define GPIB_REMOTE_AND_LOCKED (globals.Remote.gpib_remote && globals.Remote.gpib_lock) static void update_remote_mode () { - int gpib_remote, gpib_lockout; - GPIB_check_remote_status (&gpib_remote, &gpib_lockout); - - globals.Remote.mode = 0; - if (gpib_lockout) { - globals.Remote.mode += RM_LOCK; - } - if (gpib_remote) { - globals.Remote.mode += RM_REM; - } + GPIB_check_remote_status (&globals.Remote.gpib_remote, &globals.Remote.gpib_lock); } @@ -900,7 +886,7 @@ void Show_Main_Menu(void) raw_str = g_string_append (raw_str, "LOCAL+"); } - if (globals.Remote.mode & RM_REM) { + if (globals.Remote.gpib_remote) { raw_str = g_string_append (raw_str, "GPIB+"); } |