diff --git a/Source/SupportFunctions/arm_spline_interp_f32.c b/Source/SupportFunctions/arm_spline_interp_f32.c index 3ec7c642..e3a8a375 100644 --- a/Source/SupportFunctions/arm_spline_interp_f32.c +++ b/Source/SupportFunctions/arm_spline_interp_f32.c @@ -149,6 +149,14 @@ * @param[in] blockSize number of samples of output data. */ +/* + +Temporary fix because some arrays are defined on the stack. +They should be passed as additional arguments to the function. + +*/ +#define MAX_DATA_POINTS 40 + void arm_spline_f32( arm_spline_instance_f32 * S, const float32_t * x, @@ -157,6 +165,7 @@ void arm_spline_f32( float32_t * pDst, uint32_t blockSize) { + /* As explained in arm_spline_interp_init_f32.c, this must be > 1 @@ -167,8 +176,13 @@ void arm_spline_f32( float32_t hi, hm1; - /* Temporary variables for system AX=B */ - float32_t u[n-1], z[n], c[n]; + /* + + Temporary variables for system AX=B. + This will be replaced by new arguments for the function. + + */ + float32_t u[MAX_DATA_POINTS], z[MAX_DATA_POINTS], c[MAX_DATA_POINTS]; float32_t Bi, li; float32_t bi, di; @@ -348,7 +362,8 @@ void arm_spline_f32( pDst++; blkCnt2--; - } + } + } /**