导航: 老古网老古论坛XMOS公共讨论区XMOS开源项目区单片机程序设计嵌入式系统广告区域
→[转帖]怎么样结合C语言和XC[liufengzhong]

 *第63660篇: [转帖]怎么样结合C语言和XC

  
楼 主:liufengzhong 2014年7月31日17:19
 [转帖]怎么样结合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起)。


>>>>>>对该主题发表你的看法

本主题贴数1,分页: [第1页]


[上一篇主题]:[转帖]在dj kit上实现循环缓冲区

[下一篇主题]:可以一个快速xmos链接(5线)改为两个慢速链接(双线)吗?[转帖]