summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--device-functions.c34
-rw-r--r--error_utils.c4
-rw-r--r--flash.c1
-rw-r--r--globals.h4
-rw-r--r--menus.c16
-rw-r--r--parser.c4
6 files changed, 30 insertions, 33 deletions
diff --git a/device-functions.c b/device-functions.c
index f25a62d..ba9459d 100644
--- a/device-functions.c
+++ b/device-functions.c
@@ -99,7 +99,7 @@ void Main_Rst (void)
globals.ChannelState[i].zout=globals.Flash.zout_min[i];
globals.ChannelState[i].hold_setting = hold_width;
globals.ChannelState[i].double_pulse = double_off;
- globals.ChannelState[i].ab_mode = pw_normal;
+ globals.ChannelState[i].pw_ctrl_mode = pw_normal;
globals.ChannelState[i].func_mode = pulse_mode_on;
globals.ChannelState[i].polarity = globals.Flash.invert_by_default[i];
globals.ChannelState[i].output_state = output_off;
@@ -129,7 +129,7 @@ void Main_Rst (void)
Set_frequency(0,0,0,i,globals.ChannelState[i].frequency);
Set_Delay(0,0,0,i,globals.ChannelState[i].delay);
Set_Double(i,globals.ChannelState[i].double_pulse);
- Set_Pwmode(i,globals.ChannelState[i].ab_mode);
+ Set_Pwmode(i,globals.ChannelState[i].pw_ctrl_mode);
Set_Func(i,globals.ChannelState[i].func_mode);
Set_Pol(i,globals.ChannelState[i].polarity);
Set_Gate_Sync(i,globals.ChannelState[i].gate_type);
@@ -847,9 +847,9 @@ void Set_Mux(int channel)
mux_out=4;
} else if (globals.ChannelState[channel].func_mode==dc_mode_on && globals.ChannelState[channel].polarity!=pol_norm) {
mux_out=5;
- } else if (globals.ChannelState[channel].ab_mode==pw_normal && globals.ChannelState[channel].polarity==pol_norm) {
+ } else if (globals.ChannelState[channel].pw_ctrl_mode==pw_normal && globals.ChannelState[channel].polarity==pol_norm) {
mux_out=2;
- } else if (globals.ChannelState[channel].ab_mode==pw_normal && globals.ChannelState[channel].polarity!=pol_norm) {
+ } else if (globals.ChannelState[channel].pw_ctrl_mode==pw_normal && globals.ChannelState[channel].polarity!=pol_norm) {
mux_out=3;
} else if (globals.ChannelState[channel].polarity==pol_norm) {
mux_out=0;
@@ -1026,7 +1026,7 @@ int Set_Output_State(int channel,int mode)
int Set_Trig_Source(int channel,int mode)
{
int gate_mode;
- int use_ab_mode;
+ int use_pw_ctrl_mode;
int reset_freq;
float use_freq;
@@ -1035,7 +1035,7 @@ int Set_Trig_Source(int channel,int mode)
return InvalidChannel;
}
- use_ab_mode = globals.ChannelState[channel].ab_mode;
+ use_pw_ctrl_mode = globals.ChannelState[channel].pw_ctrl_mode;
use_freq = globals.ChannelState[channel].frequency;
reset_freq = 0;
@@ -1049,10 +1049,10 @@ int Set_Trig_Source(int channel,int mode)
if ((globals.ChannelState[channel].trigger_source != source_hold) && (mode != source_hold)) {
reset_freq = 1;
use_freq = globals.Flash.min_freq[channel];
- use_ab_mode = pw_normal;
+ use_pw_ctrl_mode = pw_normal;
}
- TestState[channel].ab_mode = use_ab_mode;
+ TestState[channel].pw_ctrl_mode = use_pw_ctrl_mode;
TestState[channel].frequency = use_freq;
if ((error_num=Error_check(TestState))) {
@@ -1061,7 +1061,7 @@ int Set_Trig_Source(int channel,int mode)
if (reset_freq) {
Set_frequency(0,0,0,channel,use_freq);
- Set_Pwmode(channel,use_ab_mode);
+ Set_Pwmode(channel,use_pw_ctrl_mode);
}
}
@@ -1374,7 +1374,7 @@ int Set_Pwmode(int channel,int mode)
return AB_Mode_Error;
}
- globals.ChannelState[channel].ab_mode=mode;
+ globals.ChannelState[channel].pw_ctrl_mode=mode;
Set_Mux(0);
Set_Update_Chans();
@@ -1426,8 +1426,8 @@ int Set_Update_Chans(void)
if (!globals.Flash.ChanKey_double_pulse) for (i=1; i<num_of_chan; ++i) {
globals.ChannelState[i].double_pulse=globals.ChannelState[0].double_pulse;
}
- if (!globals.Flash.ChanKey_ab_mode) for (i=1; i<num_of_chan; ++i) {
- globals.ChannelState[i].ab_mode=globals.ChannelState[0].ab_mode;
+ if (!globals.Flash.ChanKey_pw_mode) for (i=1; i<num_of_chan; ++i) {
+ globals.ChannelState[i].pw_ctrl_mode=globals.ChannelState[0].pw_ctrl_mode;
}
if (!globals.Flash.ChanKey_func_mode) for (i=1; i<num_of_chan; ++i) {
globals.ChannelState[i].func_mode=globals.ChannelState[0].func_mode;
@@ -4460,8 +4460,7 @@ void Set_Rcl(int setting_num)
}
globals.ChannelState[i].hold_setting = (temp >> 1) & 1;
globals.ChannelState[i].double_pulse = (temp >> 2) & 1;
- globals.ChannelState[i].ab_mode = (temp >> 3) & 1;
- /* one bit removed */
+ globals.ChannelState[i].pw_ctrl_mode = (temp >> 3) & 3;
globals.ChannelState[i].polarity = (temp >> 5) & 1;
globals.ChannelState[i].output_state = (temp >> 6) & 1;
globals.ChannelState[i].gate_type = (temp >> 7) & 1;
@@ -4485,7 +4484,7 @@ void Set_Rcl(int setting_num)
Set_Pw(0,0,0,i,globals.ChannelState[i].pw,0);
Set_Double(i,globals.ChannelState[i].double_pulse);
- Set_Pwmode(i,globals.ChannelState[i].ab_mode);
+ Set_Pwmode(i,globals.ChannelState[i].pw_ctrl_mode);
Set_Func(i,globals.ChannelState[i].func_mode);
Set_Pol(i,globals.ChannelState[i].polarity);
@@ -4564,7 +4563,7 @@ void Set_Sav(int setting_num)
globals.ChannelState[i].zout 50 (1) or min (0)
globals.ChannelState[i].hold_setting hold_width 0, hold_duty 1
globals.ChannelState[i].double_pulse double_on 1, double_off 0
- globals.ChannelState[i].ab_mode pw_normal 1, pw_in_out 0
+ globals.ChannelState[i].pw_ctrl_mode pw_normal 1, pw_in_out 0
globals.ChannelState[i].func_mode pulse_mode_on 0, dc_mode_on 1
globals.ChannelState[i].polarity pol_norm 0, pol_complement 1
globals.ChannelState[i].output_state output_off 0,output_on 1
@@ -4582,8 +4581,7 @@ void Set_Sav(int setting_num)
}
temp |= globals.ChannelState[i].hold_setting << 1;
temp |= globals.ChannelState[i].double_pulse << 2;
- temp |= globals.ChannelState[i].ab_mode << 3;
- /* removed one bit */
+ temp |= globals.ChannelState[i].pw_ctrl_mode << 3;
temp |= globals.ChannelState[i].polarity << 5;
temp |= globals.ChannelState[i].output_state << 6;
temp |= globals.ChannelState[i].gate_type << 7;
diff --git a/error_utils.c b/error_utils.c
index 1b0b19e..5e68ba6 100644
--- a/error_utils.c
+++ b/error_utils.c
@@ -588,8 +588,8 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels])
if (!globals.Flash.ChanKey_double_pulse) for (i=1; i<num_of_chan; ++i) {
ChannelStateToTest[i].double_pulse=ChannelStateToTest[0].double_pulse;
}
- if (!globals.Flash.ChanKey_ab_mode) for (i=1; i<num_of_chan; ++i) {
- ChannelStateToTest[i].ab_mode=ChannelStateToTest[0].ab_mode;
+ if (!globals.Flash.ChanKey_pw_mode) for (i=1; i<num_of_chan; ++i) {
+ ChannelStateToTest[i].pw_ctrl_mode=ChannelStateToTest[0].pw_ctrl_mode;
}
if (!globals.Flash.ChanKey_func_mode) for (i=1; i<num_of_chan; ++i) {
ChannelStateToTest[i].func_mode=ChannelStateToTest[0].func_mode;
diff --git a/flash.c b/flash.c
index fe4adeb..d219054 100644
--- a/flash.c
+++ b/flash.c
@@ -437,7 +437,6 @@ static void initFlashValues(FlashStruct *mem)
mem->ChanKey_zout=0;
mem->ChanKey_hold_setting=0;
mem->ChanKey_double_pulse=0;
- mem->ChanKey_ab_mode=0;
mem->ChanKey_route=0;
mem->ChanKey_slew=0;
diff --git a/globals.h b/globals.h
index bb0f7b9..7a02879 100644
--- a/globals.h
+++ b/globals.h
@@ -327,7 +327,7 @@ typedef struct {
int zout; /* Zout in ohms, integer */
int hold_setting; /* pw or duty cycle hold when prf changed */
int double_pulse; /* 1=on, 0=off */
- int ab_mode; /* a/b mode */
+ int pw_ctrl_mode; /* a/b mode */
int func_mode; /* dc or pulse */
int polarity; /* noninverted or inverted */
int output_state; /* on or off */
@@ -411,7 +411,7 @@ typedef struct {
char ChanKey_zout; /* 181 */
char ChanKey_hold_setting; /* 182 */
char ChanKey_double_pulse; /* 183 */
- char ChanKey_ab_mode; /* 184 */
+ char ChanKey_unused; /* 184 */
char ChanKey_func_mode; /* 185 */
char ChanKey_polarity; /* 186 */
char ChanKey_output_state; /* 187 */
diff --git a/menus.c b/menus.c
index d9acef3..c7a4195 100644
--- a/menus.c
+++ b/menus.c
@@ -408,7 +408,7 @@ void Show_Main_Menu(void)
for (chan=0; chan<(globals.Flash.ChanKey_delay?globals.Flash.channels:1); ++chan)
if ( (globals.ChannelState[chan].amp_mode!=amp_mode_amplify)
- && (globals.ChannelState[chan].ab_mode!=pw_in_out)
+ && (globals.ChannelState[chan].pw_ctrl_mode!=pw_in_out)
&& ((globals.ChannelState[chan].func_mode==pulse_mode_on)
|| (globals.ChannelState[chan].func_mode==dc_mode_on))
) {
@@ -449,7 +449,7 @@ void Show_Main_Menu(void)
show_item=Show_No_Number;
if (globals.ChannelState[chan].func_mode==pulse_mode_on) {
- if (globals.ChannelState[chan].ab_mode==pw_normal) {
+ if (globals.ChannelState[chan].pw_ctrl_mode==pw_normal) {
if (globals.ChannelState[chan].hold_setting==hold_width) {
show_item=Show_pw+chan;
menu_string = g_string_append (menu_string, "PW");
@@ -1281,7 +1281,7 @@ static void Submenu_Display(int change_selection)
break;
case Submenu1_pw:
- if (globals.ChannelState[channel].ab_mode==pw_normal) {
+ if (globals.ChannelState[channel].pw_ctrl_mode==pw_normal) {
if (globals.ChannelState[channel].hold_setting==hold_width) {
title = g_strdup ("Pulse Width:");
Submenu_Numeric_Parameter=Show_pw+channel;
@@ -1679,20 +1679,20 @@ static void Submenu_Display(int change_selection)
case mode_pw_norm:
mode_name = g_strdup("Normal");
if (globals.ChannelState[channel].func_mode==pulse_mode_on
- && globals.ChannelState[channel].hold_setting==hold_width && globals.ChannelState[channel].ab_mode==pw_normal) {
+ && globals.ChannelState[channel].hold_setting==hold_width && globals.ChannelState[channel].pw_ctrl_mode==pw_normal) {
current_operating_mode=i;
}
break;
case mode_pw_duty:
mode_name = g_strdup("Duty Cycle");
if (globals.ChannelState[channel].func_mode==pulse_mode_on
- && globals.ChannelState[channel].hold_setting==hold_duty && globals.ChannelState[channel].ab_mode==pw_normal) {
+ && globals.ChannelState[channel].hold_setting==hold_duty && globals.ChannelState[channel].pw_ctrl_mode==pw_normal) {
current_operating_mode=i;
}
break;
case mode_pw_inout:
mode_name = g_strdup("PWin=PWout");
- if (globals.ChannelState[channel].func_mode==pulse_mode_on && globals.ChannelState[channel].ab_mode==pw_in_out) {
+ if (globals.ChannelState[channel].func_mode==pulse_mode_on && globals.ChannelState[channel].pw_ctrl_mode==pw_in_out) {
current_operating_mode=i;
}
break;
@@ -2981,7 +2981,7 @@ static int Submenu_Implement_Changes(void)
break;
case mode_pw_norm:
globals.ChannelState[channel].hold_setting=hold_width;
- if ( (globals.ChannelState[channel].ab_mode!=pw_normal) || (globals.ChannelState[channel].func_mode!=pulse_mode_on)) {
+ if ( (globals.ChannelState[channel].pw_ctrl_mode!=pw_normal) || (globals.ChannelState[channel].func_mode!=pulse_mode_on)) {
if (error_num=Set_Func(channel,pulse_mode_on)) {
return error_num;
}
@@ -2995,7 +2995,7 @@ static int Submenu_Implement_Changes(void)
break;
case mode_pw_duty:
globals.ChannelState[channel].hold_setting=hold_duty;
- if ( (globals.ChannelState[channel].ab_mode!=pw_normal) || (globals.ChannelState[channel].func_mode!=pulse_mode_on)) {
+ if ( (globals.ChannelState[channel].pw_ctrl_mode!=pw_normal) || (globals.ChannelState[channel].func_mode!=pulse_mode_on)) {
if (error_num=Set_Func(channel,pulse_mode_on)) {
return error_num;
}
diff --git a/parser.c b/parser.c
index 5b4779a..0147e69 100644
--- a/parser.c
+++ b/parser.c
@@ -1774,7 +1774,7 @@ static int Go_pw_36(gchar** response, int channel, char *parameter,char *units,i
break;
case query_simple:
- if (globals.ChannelState[channel].ab_mode==pw_normal) {
+ if (globals.ChannelState[channel].pw_ctrl_mode==pw_normal) {
return query_float(response, globals.ChannelState[channel].pw);
} else {
return query_string(response, "The output pulse width is equal to the input pulse width.");
@@ -3617,7 +3617,7 @@ static int Go_puls_sep_89(gchar** response, int channel, char *parameter,char *u
/* no break */
case command_withparam:
- globals.ChannelState[channel].ab_mode=pw_normal;
+ globals.ChannelState[channel].pw_ctrl_mode=pw_normal;
if (status = process_float_param (parameter, &new_pw, globals.Constraints.err_min_burst_time[channel], globals.Constraints.err_max_burst_time[channel], NORMAL_ZERO)) {
return status;
}