summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael J. Chudobiak <mjc@avtechpulse.com>2020-07-27 09:52:30 -0400
committerMichael J. Chudobiak <mjc@avtechpulse.com>2020-07-27 09:52:30 -0400
commit188ba0eb92a6961059fd9052130806b0bc2f5e23 (patch)
tree5724bc0df7acaec4c09c59fa95eb1610cb729833
parent4ce3a41b8a9c1cbc8db34b6d98c0417b291a3cf1 (diff)
add support for new jig pin on keypad 104G
-rw-r--r--error_utils.c5
-rw-r--r--flash.c1
-rw-r--r--globals.h5
-rw-r--r--menus.c4
4 files changed, 14 insertions, 1 deletions
diff --git a/error_utils.c b/error_utils.c
index 297f6fa..265ae75 100644
--- a/error_utils.c
+++ b/error_utils.c
@@ -53,6 +53,7 @@ void set_gpib_error_flags (int error_num)
case Overload_Detected:
case Overtemp_Detected:
case Overvolt_Detected:
+ case Jig_Open_Detected:
case Device_Specific_Aux_Error_Detected:
case queue_overflow:
case CalibrationPercentError:
@@ -454,6 +455,10 @@ void get_error_text(gchar **response, int error_num)
format_error_text(response,-300,"Power supply overload detected. Output disabled.");
break;
+ case Jig_Open_Detected:
+ format_error_text(response,-300,globals.Flash.jig_error_message);
+ break;
+
case Overtemp_Detected:
format_error_text(response,-300,globals.Flash.ot_error_message);
break;
diff --git a/flash.c b/flash.c
index 3b06b79..a384c90 100644
--- a/flash.c
+++ b/flash.c
@@ -897,6 +897,7 @@ static void initFlashValues(FlashStruct *mem)
strcpy(mem->aux_error_message,"PRF too high! Output disabled.");
strcpy(mem->ot_error_message,"Over-heating problem. Output off.");
strcpy(mem->ov_error_message,"Over-voltage/over-current. Output off.");
+ strcpy(mem->jig_error_message,"Jig lid is open. Output off.");
/* default PW DACs */
mem->pw_dac[0]=2; /* channel 1: ONLY used for EXTERNAL voltage-controlled PW */
diff --git a/globals.h b/globals.h
index 0ecb22b..ce1227b 100644
--- a/globals.h
+++ b/globals.h
@@ -114,6 +114,7 @@
#define Between_0_and_10_Volts 96
#define pw_rc_limit 97
#define HVPS_Current_Too_High 98
+#define Jig_Open_Detected 99
#define YES 1
#define NO 0
@@ -832,7 +833,9 @@ typedef struct {
float max_mon_steps_before_reset_average[max_channels]; // size 8, addr 37412 - 5 steps for AVO-8E3, maybe more for 156A?
- char flash_end; // addr 37420
+ char jig_error_message[40]; // addr 37420
+
+ char flash_end; // addr 37460
} FlashStruct;
#pragma pack(pop)
diff --git a/menus.c b/menus.c
index f717508..840211e 100644
--- a/menus.c
+++ b/menus.c
@@ -2803,6 +2803,7 @@ static void Read_Keypad(int *button_port_val, int *upper_encoder_val, int *lower
#define Over_Temp 0x10 /* over-temperature */
#define Over_Volt 0x20 /* over-voltage */
#define Over_Other 0x40 /* over-other */
+#define Jig_Input 0x08 /* jig open */
int new_button_state;
@@ -2844,6 +2845,7 @@ static void Read_Keypad(int *button_port_val, int *upper_encoder_val, int *lower
/* valid for both local and remote modes */
if ( !(*upper_encoder_val & Over_Temp)
|| !(*upper_encoder_val & Over_Volt)
+ || !(*upper_encoder_val & Jig_Input)
|| !(*upper_encoder_val & Over_Other)
|| !(*button_port_val & Overload_Input) ) {
@@ -2866,6 +2868,8 @@ static void Read_Keypad(int *button_port_val, int *upper_encoder_val, int *lower
queue_and_broadcast_sensor_alarm(Overtemp_Detected);
} else if (!(*upper_encoder_val & Over_Volt)) {
queue_and_broadcast_sensor_alarm(Overvolt_Detected);
+ } else if (!(*upper_encoder_val & Jig_Input)) {
+ queue_and_broadcast_sensor_alarm(Jig_Open_Detected);
} else if (!(*upper_encoder_val & Over_Other)) {
queue_and_broadcast_sensor_alarm(Device_Specific_Aux_Error_Detected);
} else if (!(*button_port_val & Overload_Input)) {