打印

为什么编译不能通过

[复制链接]
279|4
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
houcs|  楼主 | 2018-4-16 11:35 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
** ERROR #A51 IN 3094 (E:\PSOC\My-shiyan\out_io\out_io.cydsn\main.src, LINE 118): TARGET OUT OF RANGE
The command 'Ax51.exe' failed with exit code '2'.
沙发
liuzaiy| | 2018-4-16 11:38 | 只看该作者
工程代码能发上来么?

使用特权

评论回复
板凳
houcs|  楼主 | 2018-4-16 11:41 | 只看该作者

代码如下:也不知道错误信息中的不知道code '2'代表什么?
#include <device.h>
void main()
{
    /* Place your initialization/startup code here (e.g. MyInst_Start()) */

    /* CyGlobalIntEnable; */ /* Uncomment this line to enable global interrupts. */
    for(;;)
    {
SFRPRT2SEL |= 0xFF; //enables the control of the port
#pragma asm
loop:
mov A, SFRPRT2PS ; 1 Clock Reads the value of port2
inc A ; 1 Clock Adds 1
mov SFRPRT2DR,A ; 1 Clock Writes to port2
;
REPT 992 ; delay for 992 clock cycles
NOP ; 1*992=992 Clock Cycles
ENDM
;
jmp loop ; 5 clock
#pragma endasm
    }
}

/* [] END OF FILE */

使用特权

评论回复
地板
yinxiangh| | 2018-4-16 11:45 | 只看该作者
估计是你没有enable assembly for main.c file. Creator > WorkSpace explorer > Project > main.c > right clicking > Building setting > Compiler > Inline Assemble > Enable(disable in default).

使用特权

评论回复
5
houcs|  楼主 | 2018-4-16 12:06 | 只看该作者
搞定了,呵呵,犯了低级错误……结贴啦,多谢各位

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

743

主题

8382

帖子

5

粉丝