summaryrefslogtreecommitdiff
path: root/error_utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'error_utils.c')
-rw-r--r--error_utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/error_utils.c b/error_utils.c
index cc08a3f..5edea83 100644
--- a/error_utils.c
+++ b/error_utils.c
@@ -913,7 +913,7 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels])
check_another_max_value (temp, &globals.Constraints.err_max_freq[i], ChannelStateToTest[i].frequency, HVPS_Current_Too_High, &report_error);
}
- if (globals.Flash.max_avg_power[i] > 0.0) {
+ if ((globals.Flash.max_avg_power[i] > 0.0) && (fabs(ChannelStateToTest[i].amplitude) > 0.0)) {
temp = (globals.Flash.max_avg_power[i] * ChannelStateToTest[i].load_type) / (ChannelStateToTest[i].amplitude * ChannelStateToTest[i].amplitude * ChannelStateToTest[i].pw);
check_another_max_value (temp, &globals.Constraints.err_max_freq[i], ChannelStateToTest[i].frequency, average_power_limit, &report_error);
}
@@ -977,7 +977,7 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels])
&globals.Constraints.err_max_pw[i], ChannelStateToTest[i].pw, HVPS_Current_Too_High, &report_error);
}
- if (globals.Flash.max_avg_power[i] > 0.0) {
+ if ((globals.Flash.max_avg_power[i] > 0.0) && (fabs(ChannelStateToTest[i].amplitude) > 0.0)) {
check_another_max_value (globals.Flash.max_avg_power[i] * ChannelStateToTest[i].load_type /
(ChannelStateToTest[i].amplitude * ChannelStateToTest[i].amplitude * ChannelStateToTest[i].frequency),
&globals.Constraints.err_max_pw[i], ChannelStateToTest[i].pw, average_power_limit, &report_error);