Skip to content

Commit

Permalink
Fix const errors when compiling for Cortex M0
Browse files Browse the repository at this point in the history
  • Loading branch information
torfinnberset committed Feb 11, 2019
1 parent 23765ae commit db3a3ae
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 34 deletions.
20 changes: 10 additions & 10 deletions Source/FilteringFunctions/arm_biquad_cascade_df1_q15.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,16 +301,16 @@ void arm_biquad_cascade_df1_q15(

/* Run the below code for Cortex-M0 */

q15_t *pIn = pSrc; /* Source pointer */
q15_t *pOut = pDst; /* Destination pointer */
q15_t b0, b1, b2, a1, a2; /* Filter coefficients */
q15_t Xn1, Xn2, Yn1, Yn2; /* Filter state variables */
q15_t Xn; /* temporary input */
q63_t acc; /* Accumulator */
int32_t shift = (15 - (int32_t) S->postShift); /* Post shift */
q15_t *pState = S->pState; /* State pointer */
const q15_t *pCoeffs = S->pCoeffs; /* Coefficient pointer */
uint32_t sample, stage = (uint32_t) S->numStages; /* Stage loop counter */
const q15_t *pIn = pSrc; /* Source pointer */
q15_t *pOut = pDst; /* Destination pointer */
q15_t b0, b1, b2, a1, a2; /* Filter coefficients */
q15_t Xn1, Xn2, Yn1, Yn2; /* Filter state variables */
q15_t Xn; /* temporary input */
q63_t acc; /* Accumulator */
int32_t shift = (15 - (int32_t) S->postShift); /* Post shift */
q15_t *pState = S->pState; /* State pointer */
const q15_t *pCoeffs = S->pCoeffs; /* Coefficient pointer */
uint32_t sample, stage = (uint32_t) S->numStages; /* Stage loop counter */

do
{
Expand Down
2 changes: 1 addition & 1 deletion Source/FilteringFunctions/arm_fir_interpolate_f32.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ void arm_fir_interpolate_f32(
float32_t *pState = S->pState; /* State pointer */
const float32_t *pCoeffs = S->pCoeffs; /* Coefficient pointer */
float32_t *pStateCurnt; /* Points to the current sample of the state */
float32_t *ptr1, *ptr2; /* Temporary pointers for state and coefficient buffers */
const float32_t *ptr1, *ptr2; /* Temporary pointers for state and coefficient buffers */


float32_t sum; /* Accumulator */
Expand Down
2 changes: 1 addition & 1 deletion Source/FilteringFunctions/arm_fir_interpolate_q15.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ void arm_fir_interpolate_q15(
ptr1 = pState;

/* Initialize coefficient pointer */
ptr2 = pCoeffs + (i - 1U);
ptr2 = (q15_t*) pCoeffs + (i - 1U);

/* Loop over the polyPhase length */
tapCnt = (uint32_t) phaseLen;
Expand Down
2 changes: 1 addition & 1 deletion Source/FilteringFunctions/arm_fir_interpolate_q31.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ void arm_fir_interpolate_q31(
ptr1 = pState;

/* Initialize coefficient pointer */
ptr2 = pCoeffs + (i - 1U);
ptr2 = (q31_t*) pCoeffs + (i - 1U);

tapCnt = phaseLen;

Expand Down
6 changes: 3 additions & 3 deletions Source/FilteringFunctions/arm_fir_lattice_q31.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,9 @@ void arm_fir_lattice_q31(
uint32_t blockSize)
{
q31_t *pState; /* State pointer */
const q31_t *pCoeffs = S->pCoeffs; /* Coefficient pointer */
const q31_t *px; /* temporary state pointer */
q31_t *pk; /* temporary coefficient pointer */
const q31_t *pCoeffs = S->pCoeffs; /* Coefficient pointer */
q31_t *px; /* temporary state pointer */
const q31_t *pk; /* temporary coefficient pointer */
q31_t fcurr, fnext, gcurr, gnext; /* temporary variables */
uint32_t numStages = S->numStages; /* Length of the filter */
uint32_t blkCnt, stageCnt; /* temporary variables for counts */
Expand Down
2 changes: 1 addition & 1 deletion Source/FilteringFunctions/arm_iir_lattice_f32.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ void arm_iir_lattice_f32(
float32_t fcurr, fnext = 0, gcurr, gnext; /* Temporary variables for lattice stages */
float32_t acc; /* Accumlator */
uint32_t blkCnt, tapCnt; /* temporary variables for counts */
const float32_t *px1, *px2, *pk, *pv; /* temporary pointers for state and coef */
float32_t *px1, *px2, *pk, *pv; /* temporary pointers for state and coef */
uint32_t numStages = S->numStages; /* number of stages */
float32_t *pState; /* State pointer */
float32_t *pStateCurnt; /* State current pointer */
Expand Down
2 changes: 1 addition & 1 deletion Source/FilteringFunctions/arm_iir_lattice_q15.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ void arm_iir_lattice_q15(
uint32_t stgCnt; /* Temporary variables for counts */
q63_t acc; /* Accumlator */
uint32_t blkCnt, tapCnt; /* Temporary variables for counts */
const q15_t *px1, *px2, *pk, *pv; /* temporary pointers for state and coef */
q15_t *px1, *px2, *pk, *pv; /* temporary pointers for state and coef */
uint32_t numStages = S->numStages; /* number of stages */
q15_t *pState; /* State pointer */
q15_t *pStateCurnt; /* State current pointer */
Expand Down
6 changes: 3 additions & 3 deletions Source/FilteringFunctions/arm_lms_f32.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ void arm_lms_f32(
uint32_t blockSize)
{
float32_t *pState = S->pState; /* State pointer */
const float32_t *pCoeffs = S->pCoeffs; /* Coefficient pointer */
const float32_t *pCoeffs = S->pCoeffs; /* Coefficient pointer */
float32_t *pStateCurnt; /* Points to the current sample of the state */
float32_t *px, *pb; /* Temporary pointers for state and coefficient buffers */
float32_t mu = S->mu; /* Adaptive factor */
Expand Down Expand Up @@ -347,7 +347,7 @@ void arm_lms_f32(
px = pState;

/* Initialize pCoeffs pointer */
pb = pCoeffs;
pb = (float32_t*) pCoeffs;

/* Set the accumulator to zero */
sum = 0.0f;
Expand Down Expand Up @@ -379,7 +379,7 @@ void arm_lms_f32(
px = pState;

/* Initialize pCoeffs pointer */
pb = pCoeffs;
pb = (float32_t *) pCoeffs;

/* Loop over numTaps number of values */
tapCnt = numTaps;
Expand Down
4 changes: 2 additions & 2 deletions Source/FilteringFunctions/arm_lms_norm_f32.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ void arm_lms_norm_f32(
px = pState;

/* Initialize pCoeffs pointer */
pb = pCoeffs;
pb = (float32_t*) pCoeffs;

/* Read the sample from input buffer */
in = *pSrc++;
Expand Down Expand Up @@ -399,7 +399,7 @@ void arm_lms_norm_f32(
px = pState;

/* Initialize pCcoeffs pointer */
pb = pCoeffs;
pb = (float32_t*) pCoeffs;

/* Loop over numTaps number of values */
tapCnt = numTaps;
Expand Down
4 changes: 2 additions & 2 deletions Source/FilteringFunctions/arm_lms_norm_q15.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ void arm_lms_norm_q15(
px = pState;

/* Initialize pCoeffs pointer */
pb = pCoeffs;
pb = (q15_t *) pCoeffs;

/* Read the sample from input buffer */
in = *pSrc++;
Expand Down Expand Up @@ -370,7 +370,7 @@ void arm_lms_norm_q15(
px = pState;

/* Initialize coeff pointer */
pb = (pCoeffs);
pb = (q15_t *) (pCoeffs);

/* Loop over numTaps number of values */
tapCnt = numTaps;
Expand Down
4 changes: 2 additions & 2 deletions Source/FilteringFunctions/arm_lms_norm_q31.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ void arm_lms_norm_q31(
px = pState;

/* Initialize pCoeffs pointer */
pb = pCoeffs;
pb = (q31_t *) pCoeffs;

/* Read the sample from input buffer */
in = *pSrc++;
Expand Down Expand Up @@ -358,7 +358,7 @@ void arm_lms_norm_q31(
px = pState;

/* Initialize coeff pointer */
pb = (pCoeffs);
pb = (q31_t *) (pCoeffs);

/* Loop over numTaps number of values */
tapCnt = numTaps;
Expand Down
4 changes: 2 additions & 2 deletions Source/FilteringFunctions/arm_lms_q15.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ void arm_lms_q15(
px = pState;

/* Initialize pCoeffs pointer */
pb = pCoeffs;
pb = (q15_t *) pCoeffs;

/* Set the accumulator to zero */
acc = 0;
Expand Down Expand Up @@ -320,7 +320,7 @@ void arm_lms_q15(
px = pState++;

/* Initialize pCoeffs pointer */
pb = pCoeffs;
pb = (q15_t *) pCoeffs;

/* Loop over numTaps number of values */
tapCnt = numTaps;
Expand Down
4 changes: 2 additions & 2 deletions Source/FilteringFunctions/arm_lms_q31.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ void arm_lms_q31(
px = pState;

/* Initialize pCoeffs pointer */
pb = pCoeffs;
pb = (q31_t *) pCoeffs;

/* Set the accumulator to zero */
acc = 0;
Expand Down Expand Up @@ -309,7 +309,7 @@ void arm_lms_q31(
px = pState++;

/* Initialize pCoeffs pointer */
pb = pCoeffs;
pb = (q31_t *) pCoeffs;

/* Loop over numTaps number of values */
tapCnt = numTaps;
Expand Down
6 changes: 3 additions & 3 deletions Source/MatrixFunctions/arm_mat_mult_q15.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,12 +359,12 @@ arm_status arm_mat_mult_q15(

/* Run the below code for Cortex-M0 */

const q15_t *pIn1 = pSrcA->pData; /* input data matrix pointer A */
const q15_t *pIn2 = pSrcB->pData; /* input data matrix pointer B */
const q15_t *pIn1 = pSrcA->pData; /* input data matrix pointer A */
const q15_t *pIn2 = pSrcB->pData; /* input data matrix pointer B */
q15_t *pInA = pSrcA->pData; /* input data matrix pointer A of Q15 type */
q15_t *pInB = pSrcB->pData; /* input data matrix pointer B of Q15 type */
q15_t *pOut = pDst->pData; /* output data matrix pointer */
const q15_t *px; /* Temporary output data matrix pointer */
q15_t *px; /* Temporary output data matrix pointer */
uint16_t numColsB = pSrcB->numCols; /* number of columns of input matrix B */
uint16_t numColsA = pSrcA->numCols; /* number of columns of input matrix A */
uint16_t numRowsA = pSrcA->numRows; /* number of rows of input matrix A */
Expand Down

0 comments on commit db3a3ae

Please sign in to comment.