diff options
Diffstat (limited to 'error_utils.c')
-rw-r--r-- | error_utils.c | 27 |
1 files changed, 27 insertions, 0 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]) { |