[转帖]怎么样结合C语言和XC
我用C语言把一些dsp应用在dj kit
我的C函数是fft和input是复数,但是XC回报int值
在我的函数开头
cfunction.h
#ifndef CFUNCTION_H_
#define CFUNCTION_H_
#ifdef __XC__
#define EXTERNAL extern
#else
#define EXTERNAL extern "C"
#endif
#include <xccompat.h>
#include <complex.h>
typedef complex cplx
EXTERNAL int cfunction(int samples[]);
//EXTERNAL void fft(cplx x[], int n);
#endif /* CFUNCTION_H_ */
编译器说:error: parse error before "cplx"
怎么样正确地把C代码用在XC?
fft也包括指针,但我知道XC不支持指针。
即使接下来我这么做
#include <xccompat.h>
#include <complex.h>
EXTERNAL void fft(complex x[], int n);
compiler say:error: parse error before "_Complex"
_Complex is inside the complex.h of xc
有什么建议吗?
回答:
XC不支持C99复数(自xTIMEcomposer 13.1.0起)。
发表时间:2014年7月31日17:19:25