导航: 老古网老古论坛XMOS公共讨论区XMOS开源项目区单片机程序设计嵌入式系统广告区域
→[转帖]在xTIMEcomposer创建错误

* 108037: [转帖]在xTIMEcomposer创建错误

   liufengzhong 
liufengzhong发表的帖子 

 [转帖]在xTIMEcomposer创建错误
我创建了一个xTimeexposer项目。当我创建它时,许多错误出现

像下面:

In file included from ../src/NRF24L01.xc:8:
NRF24L01.h:17: error: `XS1_PORT_1H' undeclared here (not in a function)
In file included from ../src/NRF24L01.xc:8:
NRF24L01.h:17: error: invalid initializer
NRF24L01.h:18: error: `XS1_PORT_1E' undeclared here (not in a function)
NRF24L01.h:18: error: invalid initializer
NRF24L01.h:19: error: `XS1_PORT_1I' undeclared here (not in a function)
NRF24L01.h:19: error: invalid initializer
NRF24L01.h:20: error: `XS1_PORT_1D' undeclared here (not in a function)
NRF24L01.h:20: error: invalid initializer
NRF24L01.h:21: error: `XS1_PORT_1A' undeclared here (not in a function)
NRF24L01.h:21: error: invalid initializer
NRF24L01.h:22: error: `XS1_PORT_1C' undeclared here (not in a function)
NRF24L01.h:22: error: invalid initializer
../src/NRF24L01.xc:19: error: initializer element is not constant
../src/NRF24L01.xc:20: error: initializer element is not constant
../src/NRF24L01.xc:21: error: initializer element is not constant
../src/NRF24L01.xc: In function `init_io':
../src/NRF24L01.xc:43: error: output to an input-designated port
../src/NRF24L01.xc:44: error: unknown function identifier `delay_microseconds' (possibly missing prototype?)
../src/NRF24L01.xc: In function `SPI_RW':
../src/NRF24L01.xc:62: warning: unused variable `a'
../src/NRF24L01.xc: In function `NRF24L01_TxPacket':
../src/NRF24L01.xc:220: error: invalid operands to binary !=
../src/NRF24L01.xc: At top level:
../src/NRF24L01.xc:242: error: parse error before "bit"
../src/NRF24L01.xc: In function `Check_ACK':
../src/NRF24L01.xc:244: error: conditional expression is not arithmetic
../src/NRF24L01.xc:247: error: `clear' undeclared (first use in this function)
../src/NRF24L01.xc:247: error: (Each undeclared identifier is reported only once
../src/NRF24L01.xc:247: error: for each function it appears in.)
../src/NRF24L01.xc:250: error: output to an input-designated port
xmake[1]: *** [.build_Debug/src/NRF24L01.xc.o] Error 1
xmake: *** [bin/Debug/app_nrf24l01_soft_spi_Debug.xe] Error 2

回答:

把下面的代码添加到你源文件顶部:

#include   <xs1.h>  


发表时间:2014年8月4日14:30:16

  
回复该帖

本主题共有 1 帖,分页:>>>>>该主题的所有内容[1]条

 *树形目录 只列出部分跟帖的标题以及简单的摘要信息 该主题的部分跟帖如下:

[上一篇帖子]:[转帖]怎么样配置4x CAN端口?(CLKBLK)Hello, /P P 有可能配置
[下一篇帖子]:[转帖]Startkit ADC怎么样,有什么官方的例子吗?运行startkit至今我有个