Commit d7058765 authored by Stephanos Ioannidis's avatar Stephanos Ioannidis Committed by Anas Nashif
Browse files

DSP: Rename ROUND_UP macro to CMSIS_ROUND_UP



The ROUND_UP macro is defined by the Zephyr sys/utils.h, so rename it
to prevent conflict.

Signed-off-by: default avatarStephanos Ioannidis <root@stephanos.io>
parent 0b6673c9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ extern "C"

#define SQ(x) ((x) * (x))

#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
#define CMSIS_ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))


  /**
+1 −1
Original line number Diff line number Diff line
@@ -244,7 +244,7 @@ void arm_fir_f16(const arm_fir_instance_f16 * S,
  float16_t * pDst, 
  uint32_t blockSize)
{
    float16_t *pRefStatePtr = S->pState + ROUND_UP(blockSize, 8);
    float16_t *pRefStatePtr = S->pState + CMSIS_ROUND_UP(blockSize, 8);
    float16_t *pState = pRefStatePtr ;      /* State pointer */
    const float16_t *pCoeffs = S->pCoeffs;      /* Coefficient pointer */
    const float16_t *pSamples;  /* Temporary pointer to the sample buffer */
+1 −1
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ void arm_fir_init_f16(

  /* Clear state buffer. The size is always (blockSize + numTaps - 1) */
#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE)
  memset(pState, 0, (numTaps + (blockSize - 1U) + ROUND_UP(blockSize, 8)) * sizeof(float16_t));
  memset(pState, 0, (numTaps + (blockSize - 1U) + CMSIS_ROUND_UP(blockSize, 8)) * sizeof(float16_t));
#else
  memset(pState, 0, (numTaps + (blockSize - 1U)) * sizeof(float16_t));
#endif 
+1 −1
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ void arm_fir_init_q31(

  /* Clear state buffer. The size is always (blockSize + numTaps - 1) */
  #if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE)
  memset(pState, 0, (numTaps + (blockSize - 1U) + 2*ROUND_UP(blockSize, 4)) * sizeof(q31_t));
  memset(pState, 0, (numTaps + (blockSize - 1U) + 2*CMSIS_ROUND_UP(blockSize, 4)) * sizeof(q31_t));
  #else
  memset(pState, 0, (numTaps + (blockSize - 1U)) * sizeof(q31_t));
  #endif
+4 −4
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@
                      
#define FIR_Q31_MAIN_CORE()                                                              \
{                                                                                        \
    q31_t *pRefStatePtr = S->pState + 2*ROUND_UP(blockSize, 4);                          \
    q31_t *pRefStatePtr = S->pState + 2*CMSIS_ROUND_UP(blockSize, 4);                    \
    q31_t      *pState = pRefStatePtr; /* State pointer */                               \
    const q31_t *pCoeffs = S->pCoeffs;  /* Coefficient pointer */                        \
    q31_t       *pStateCur;             /* Points to the current sample of the state */  \
@@ -210,7 +210,7 @@ static void arm_fir_q31_1_4_mve(const arm_fir_instance_q31 * S,
    const q31_t * __restrict pSrc, 
    q31_t * __restrict pDst, uint32_t blockSize)
{
    q31_t *pRefStatePtr = S->pState + 2*ROUND_UP(blockSize, 4);
    q31_t *pRefStatePtr = S->pState + 2*CMSIS_ROUND_UP(blockSize, 4);
    q31_t      *pState = pRefStatePtr; /* State pointer */
    const q31_t    *pCoeffs = S->pCoeffs; /* Coefficient pointer */
    q31_t    *pStateCur;        /* Points to the current sample of the state */
@@ -452,7 +452,7 @@ static void arm_fir_q31_29_32_mve(const arm_fir_instance_q31 * S,
    q31_t * __restrict pDst,
                               uint32_t blockSize)
{
    q31_t *pRefStatePtr = S->pState + 2*ROUND_UP(blockSize, 4);
    q31_t *pRefStatePtr = S->pState + 2*CMSIS_ROUND_UP(blockSize, 4);
    q31_t      *pState = pRefStatePtr; /* State pointer */
    const q31_t    *pCoeffs = S->pCoeffs;       /* Coefficient pointer */
    q31_t          *pStateCur;  /* Points to the current sample of the state */
@@ -652,7 +652,7 @@ void arm_fir_q31(
        q31_t * pDst,
        uint32_t blockSize)
{
    q31_t *pRefStatePtr = S->pState + 2*ROUND_UP(blockSize, 4);
    q31_t *pRefStatePtr = S->pState + 2*CMSIS_ROUND_UP(blockSize, 4);
    q31_t      *pState = pRefStatePtr; /* State pointer */
    const q31_t    *pCoeffs = S->pCoeffs; /* Coefficient pointer */
    q31_t    *pStateCur;        /* Points to the current sample of the state */