AP_Math: improve gating of use of AP_InternalError library

- gate calls into library directly on the define
 - INTERNAL_ERROR becomes empty if library not compiled in
This commit is contained in:
Peter Barker 2023-08-15 14:14:02 +10:00 committed by Peter Barker
parent 94e61a263d
commit 8df2d4998b

View File

@ -270,7 +270,7 @@ T constrain_value_line(const T amt, const T low, const T high, uint32_t line)
// errors through any function that uses constrain_value(). The normal
// float semantics already handle -Inf and +Inf
if (isnan(amt)) {
#if !defined(IOMCU_FW)
#if AP_INTERNALERROR_ENABLED
AP::internalerror().error(AP_InternalError::error_t::constraining_nan, line);
#endif
return (low + high) / 2;