diff options
-rw-r--r-- | device-functions.c | 5 | ||||
-rw-r--r-- | flash.c | 1 | ||||
-rw-r--r-- | globals.h | 4 | ||||
-rw-r--r-- | parser.c | 16 |
4 files changed, 23 insertions, 3 deletions
diff --git a/device-functions.c b/device-functions.c index 4e7e54f..6faff3e 100644 --- a/device-functions.c +++ b/device-functions.c @@ -1370,12 +1370,17 @@ int Set_Pwmode(int channel,int mode) return SyntaxError; } + if (!(globals.Flash.ew_enabled[channel]) && (mode==pw_ew_ext)) { + return SyntaxError; + } + if ((mode==pw_in_out) && (globals.ChannelState[channel].trigger_source!=source_external)) { return AB_Mode_Error; } globals.ChannelState[channel].pw_ctrl_mode=mode; + // TODO: implement pw_ew_ext here! Set_Mux(0); Set_Update_Chans(); @@ -698,6 +698,7 @@ static void initFlashValues(FlashStruct *mem) mem->double_pulse_allowed[i]=1; mem->invert_allowed[i]=1; mem->ea_enabled[i]=1; + mem->ew_enabled[i]=0; mem->switchable_load[i]=1; mem->monitor_enabled[i]=0; mem->use_pos_ampl_data_only[i]=0; @@ -137,6 +137,7 @@ #define to_Delay 1 #define pw_in_out 0 #define pw_normal 1 +#define pw_ew_ext 2 #define double_on 1 #define double_off 0 #define pol_norm 0 @@ -711,6 +712,9 @@ typedef struct { // don't use higher ampls in AVPs, // where PW shifts near max ampl + + char ew_enabled[max_channels]; /* addr 10142 */ + char spare_end; char flash_end; @@ -1763,6 +1763,8 @@ static int Go_pw_36(gchar** response, int channel, char *parameter,char *units,i case command_withparam: if (!strcmp(parameter,"in")) { return Set_Pwmode(channel,pw_in_out); + } else if (!strcmp(parameter,"ext")) { + return Set_Pwmode(channel,pw_ew_ext); } else if (status = process_float_param (parameter, &new_pw, globals.Constraints.err_min_pw[channel], globals.Constraints.err_max_pw[channel], NORMAL_ZERO)) { return status; } @@ -1774,11 +1776,19 @@ static int Go_pw_36(gchar** response, int channel, char *parameter,char *units,i break; case query_simple: - if (globals.ChannelState[channel].pw_ctrl_mode==pw_normal) { + switch (globals.ChannelState[channel].pw_ctrl_mode) { + case pw_in_out: + return query_string(response, "IN"); + break; + case pw_ew_ext: + return query_string(response, "EXT"); + break; + default: + case 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."); + break; } + break; case query_param: |