From 96d6da4e252b06dcfdc041e7df23e86161c33007 Mon Sep 17 00:00:00 2001 From: rihab kouki Date: Tue, 28 Jul 2020 11:24:49 +0100 Subject: Official ARM version: v5.6.0 --- DSP/Source/FastMathFunctions/arm_sqrt_q15.c | 36 ++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'DSP/Source/FastMathFunctions/arm_sqrt_q15.c') diff --git a/DSP/Source/FastMathFunctions/arm_sqrt_q15.c b/DSP/Source/FastMathFunctions/arm_sqrt_q15.c index 8487ed3..fab0a32 100644 --- a/DSP/Source/FastMathFunctions/arm_sqrt_q15.c +++ b/DSP/Source/FastMathFunctions/arm_sqrt_q15.c @@ -3,13 +3,13 @@ * Title: arm_sqrt_q15.c * Description: Q15 square root function * - * $Date: 27. January 2017 - * $Revision: V.1.5.1 + * $Date: 18. March 2019 + * $Revision: V1.6.0 * * Target Processor: Cortex-M cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2017 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -29,31 +29,30 @@ #include "arm_math.h" #include "arm_common_tables.h" - /** - * @ingroup groupFastMath + @ingroup groupFastMath */ /** - * @addtogroup SQRT - * @{ + @addtogroup SQRT + @{ */ - /** - * @brief Q15 square root function. - * @param[in] in input value. The range of the input value is [0 +1) or 0x0000 to 0x7FFF. - * @param[out] *pOut square root of input value. - * @return The function returns ARM_MATH_SUCCESS if the input value is positive - * and ARM_MATH_ARGUMENT_ERROR if the input is negative. For - * negative inputs, the function returns *pOut = 0. - */ +/** + @brief Q15 square root function. + @param[in] in input value. The range of the input value is [0 +1) or 0x0000 to 0x7FFF + @param[out] pOut points to square root of input value + @return execution status + - \ref ARM_MATH_SUCCESS : input value is positive + - \ref ARM_MATH_ARGUMENT_ERROR : input value is negative; *pOut is set to 0 + */ arm_status arm_sqrt_q15( q15_t in, q15_t * pOut) { - q15_t number, temp1, var1, signBits1, half; q31_t bits_val1; + q15_t number, temp1, var1, signBits1, half; float32_t temp_float1; union { @@ -85,7 +84,7 @@ arm_status arm_sqrt_q15( /* Convert to float */ temp_float1 = number * 3.051757812500000e-005f; - /*Store as integer */ + /* Store as integer */ tempconv.floatval = temp_float1; bits_val1 = tempconv.fracval; /* Subtract the shifted value from the magic number to give intial guess */ @@ -135,10 +134,11 @@ arm_status arm_sqrt_q15( else { *pOut = 0; + return (ARM_MATH_ARGUMENT_ERROR); } } /** - * @} end of SQRT group + @} end of SQRT group */ -- cgit