diff options
author | Mike <mjc@avtechpulse.com> | 2000-01-01 03:07:30 +0900 |
---|---|---|
committer | Mike <mjc@avtechpulse.com> | 2000-01-01 03:07:30 +0900 |
commit | 28ff5a039ffe7adbcb4e9c1dd166d0273ea18f8e (patch) | |
tree | 12448cf8e4de22e83153c47b959bedbb7b033be1 | |
parent | 83ff699011be99df03fc1e07fbdc29a6c69341e4 (diff) |
first attempt at adding lower duty limit when ZOUT=MAX, for -LV option
-rw-r--r-- | error_utils.c | 27 | ||||
-rw-r--r-- | flash.c | 2 | ||||
-rw-r--r-- | globals.h | 5 | ||||
-rw-r--r-- | parser.c | 4 |
4 files changed, 36 insertions, 2 deletions
diff --git a/error_utils.c b/error_utils.c index 31676d0..22f469e 100644 --- a/error_utils.c +++ b/error_utils.c @@ -363,6 +363,14 @@ void get_error_text(gchar **response, int error_num) format_error_text(response,-222,"Duty cycle too high or load resistance too low."); break; + case max_zout_error: + format_error_text(response,-222,"Output impedance too high."); + break; + + case max_zout_duty_error: + format_error_text(response,-222,"Duty cycle too high for the internal attenuators."); + break; + case max_soft_current_limit_error: format_error_text(response,-222,"Current limit too high."); break; @@ -860,6 +868,14 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels]) max_duty_this_ampl = globals.Flash.max_duty_mid2[i]; } + // for -LV option, restrict power dissipated in internal attenuators + if (globals.Flash.switchable_zout[i] && + (globals.ChannelState[i].zout==globals.Flash.zout_max[i]) && + (globals.Flash.switchable_zout_max_duty[i] > 0.0) && + (max_duty_this_ampl > globals.Flash.switchable_zout_max_duty[i])) { + max_duty_this_ampl = globals.Flash.switchable_zout_max_duty[i]; + } + ampl_fixed_max_duty = max_duty_this_ampl; if (globals.Flash.switchable_load[i]) { ampl_fixed_max_duty = max_duty_this_ampl * (ChannelStateToTest[i].load_type / globals.Flash.low_load_type[i]); @@ -1373,6 +1389,17 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels]) check_initial_max_value (globals.Flash.max_slew[i], &globals.Constraints.err_max_slew[i], ChannelStateToTest[i].slew, max_slew_error, &report_error); } + /* --- check zout / duty settings --- */ + + check_initial_max_value (globals.Flash.zout_max[i], &globals.Constraints.err_max_zout[i], ChannelStateToTest[i].zout, max_zout_error, &report_error); + if (globals.Flash.switchable_zout[i] && + (globals.ChannelState[i].zout==globals.Flash.zout_max[i]) && + (globals.Flash.switchable_zout_max_duty[i] > 0.0) && + (duty_cycle > (globals.Flash.switchable_zout_max_duty[i] / duty_scale))) { + // can only operate at min Zout at high duty cycles, due to attenuator limits + check_another_max_value (globals.Flash.zout_min[i], &globals.Constraints.err_max_zout[i], ChannelStateToTest[i].zout, max_zout_duty_error, &report_error); + } + /* --- check resistance settings --- */ if (globals.Flash.switchable_load[i]) { @@ -747,6 +747,8 @@ static void initFlashValues(FlashStruct *mem) mem->duty_highRL_above_v[i]=110.0; mem->duty_highRL_below_v[i]=110.0; + mem->switchable_zout_max_duty[i]=0.0; + mem->mon_pw_threshold[i]=-1.0; mem->monitor_step[i]=1.0; @@ -117,6 +117,8 @@ #define Jig_Open_Detected 99 #define NoHardwareRangeFoundError 100 #define HardwareWordError 101 +#define max_zout_error 102 +#define max_zout_duty_error 103 #define YES 1 #define NO 0 @@ -852,6 +854,8 @@ typedef struct { char jig_error_message[40]; // addr 37420 + float switchable_zout_max_duty[max_channels]; // addr 37460 + char flash_end; // addr 37460 } FlashStruct; @@ -880,6 +884,7 @@ typedef struct { float err_max_slew[max_channels]; float err_min_load_type[max_channels]; float err_max_load_type[max_channels]; + float err_max_zout[max_channels]; float composite_min_burst_time[max_channels]; /* minimum ever possible gap, taking into account all constraints */ } ConstraintsStruct; @@ -2741,7 +2741,7 @@ static int Go_zout_20(gchar** response, int channel, char *parameter,char *units /* no break */ case command_withparam: - if (status=process_two_ints (parameter, &value, globals.Flash.zout_min[channel], globals.Flash.zout_max[channel])) { + if (status=process_two_ints (parameter, &value, globals.Flash.zout_min[channel], globals.Constraints.err_max_zout[channel])) { return status; } return Set_zout(channel,value,1); @@ -2752,7 +2752,7 @@ static int Go_zout_20(gchar** response, int channel, char *parameter,char *units break; case query_param: - return query_min_max_int(response, parameter, globals.Flash.zout_min[channel], globals.Flash.zout_max[channel]); + return query_min_max_int(response, parameter, globals.Flash.zout_min[channel], globals.Constraints.err_max_zout[channel]); break; default: |