From 2c8f1886f6dcf75b4798643aba8c9db6daefde5a Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 19 Jun 2023 16:44:12 +0200 Subject: [PATCH] fixed maxValue functions --- src/fsfw/globalfunctions/math/VectorOperations.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fsfw/globalfunctions/math/VectorOperations.h b/src/fsfw/globalfunctions/math/VectorOperations.h index 197cd46a..a749fd49 100644 --- a/src/fsfw/globalfunctions/math/VectorOperations.h +++ b/src/fsfw/globalfunctions/math/VectorOperations.h @@ -54,7 +54,7 @@ class VectorOperations { } static T maxAbsValue(const T *vector, uint8_t size, uint8_t *index = 0) { - T max = -1; + T max = vector[size]; for (; size > 0; size--) { T abs = vector[size - 1]; @@ -72,7 +72,7 @@ class VectorOperations { } static T maxValue(const T *vector, uint8_t size, uint8_t *index = 0) { - T max = -1; + T max = vector[size]; for (; size > 0; size--) { if (vector[size - 1] > max) { -- 2.43.0