dear ADI admins,
i'm using adsp-21479 processor, it's fine to execute below code in C but i'm not able to execute when i change the postfix from .c into .cpp. there's cc1134 error message displayed in console and sadly i can't remove the pm/dm from the declaration, in order to use biquad function inside <filters.h> i need my structure member declare in pm section.
header.h
#progma once #ifndef NSECTIONS #define NSECTIONS (1) #endif #ifndef NSTATE #define NSTATE (2*NSECTIONS) #endif typedef struct filter FILTER; struct filter { float state[NSTATE]; float pm coeffs[5*NSECTIONS]; }; FILTER* init(void* address);
source.cpp
#include header.h #include <filters.h> FILTER* init(void* address) { if (address == NULL) return NULL; FILTER* self = (FILTER*)address; self->coeffs[0] = 0.9849995433380051; self->coeffs[1] = -1.9699990866760102; self->coeffs[2] = 0.9849995433380051; self->coeffs[3] = -0.9702240460889019; self->coeffs[4] = 1.9697741272631186; for (int i = 0; i < NSTATE; i++) { self->state[i] = 0.0; } return self; }
regards,
kweiwen
typo
[edited by: kweiwen at 5:50 PM (GMT -4) on 11 Aug 2021]