the TI demo code provided the statement (without error). I need help to understand and fix this error.
RFFT32 fft=RFFT32_512P_DEFAULTS; (There are 6 different default setting).
I wish to implement switch statement which setup the fft to different setting
RFFT32 fft;
case 0:
fft = RFFT32_512P_DEFAULTS;
break;
case 1:
fft = RFFT32_256P_DEFAULTS;
break;
case 2:
fft = RFFT32_128P_DEFAULTS;
break;
However the compiler report error "Error expected a expression".
I have tried fft = (RFFT32 ) RFFT32_128P_DEFAULTS; but no luck as it report error (RFFT32) is not allowed
The compiler is Code Composer V6 (from TI) which is based on Eclipse.
There are 6 different default based on RFFT32_512P_DEFAULTS
RFFT32_512P_DEFAULTS
RFFT32_256P_DEFAULTS
RFFT32_128P_DEFAULTS, etc
where RFFT32_512P_DEFAULTS has the following code provided by TI example code.
//------------------------------------------------------------------------------------
#define RFFT32_512P_DEFAULTS { (long *)NULL,\
(long *)NULL,\
512,\
9,\
(long *)NULL,\
(long *)NULL,\
0,\
0,\
8,\
(void (*)(void *))FFT32_init,\
(void (*)(void *))FFT32_calc,\
(void (*)(void *))FFT32_mag,\
(void (*)(void *))FFT32_win
}
//-------------------------------------------------------------------------
The RFFT32 typedef struct has the following statement
typedef struct {
long *ipcbptr;
long *tfptr;
int size;
int nrstage;
long *magptr;
long *winptr;
long peakmag;
int peakfrq;
int ratio;
void (*init)(void *);
void (*calc)(void *);
void (*mag)(void *);
void (*win)(void *);
}RFFT32;
typedef RFFT32 *RFFT32_handle;