diff options
Diffstat (limited to 'error_utils.c')
-rw-r--r-- | error_utils.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/error_utils.c b/error_utils.c index 24bcd86..cc056c8 100644 --- a/error_utils.c +++ b/error_utils.c @@ -330,6 +330,10 @@ void get_error_text(gchar **response, int error_num) format_error_text(response,-222,"PW too high."); break; + case pw_rc_limit: + format_error_text(response,-222,"PW exceeds RC limit."); + break; + case max_rise_time_error: format_error_text(response,-222,"Rise time too high."); break; @@ -960,6 +964,15 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels]) report_error=pw_upper_limit; } + // RC limit, as per AVR-8F-B + temp = globals.Flash.cap_for_pw_rc_limit[i] * ChannelStateToTest[i].load_type; + if ((temp > 0.0) && (temp<globals.Constraints.err_max_pw[i])) { + globals.Constraints.err_max_pw[i]=temp; + if (ChannelStateToTest[i].pw>(1.001*globals.Constraints.err_max_pw[i])) { + report_error=pw_rc_limit; + } + } + if (ChannelStateToTest[i].double_pulse==double_on) { temp = (ChannelStateToTest[i].delay - globals.Flash.double_pulse_extra_deadtime[i]) / (1.0 + globals.Flash.double_pulse_extra_pw_margin[i]); if (temp<globals.Constraints.err_max_pw[i]) { @@ -1507,6 +1520,16 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels]) } } + if (globals.Flash.cap_for_pw_rc_limit[i] > 0.0) { + temp = ChannelStateToTest[i].pw / globals.Flash.cap_for_pw_rc_limit[i]; + if (temp > globals.Constraints.err_min_load_type[i]) { + globals.Constraints.err_min_load_type[i] = temp; + if (ChannelStateToTest[i].load_type<(0.999*globals.Constraints.err_min_load_type[i])) { + report_error=pw_rc_limit; + } + } + } + if (globals.Flash.max_peak_power[i] > 0.0) { temp = ChannelStateToTest[i].amplitude * ChannelStateToTest[i].amplitude / globals.Flash.max_peak_power[i]; if (temp > globals.Constraints.err_min_load_type[i]) { |