大家好,
我用的程序是这样的:
#include <m8c.h>
#include "PSoCAPI.h"
void main()
{
char * strPtr; // Parameter pointer 参数指针
UART_CmdReset(); // Initialize receiver/cmd 初始化接收器
// buffer 缓冲区
UART_IntCntl(UART_ENABLE_RX_INT); // Enable RX interrupts 启用UART接收器中断
Counter8_WritePeriod(155); // Set up baud rate generator 设置波特率发生器
Counter8_WriteCompareValue(77);
Counter8_Start(); // Turn on baud rate generator 打开波特率发生器
UART_Start(UART_PARITY_NONE); // Enable UART 打开串口
M8C_EnableGInt ; // Turn on interrupts 打开中断
UART_CPutString("\r\nWelcome to PSoC UART test program. V1.1 \r\n");
while(1)
{
if(UART_bCmdCheck()) // Wait for command 等待命令
{
if(strPtr = UART_szGetParam()) // More than delimiter? 超过分隔符?
{
UART_CPutString("Found valid command\r\nCommand =>");
UART_PutString(strPtr); // Print out command 打印出命令
UART_CPutString("<\r\nParamaters:\r\n");
while(strPtr = UART_szGetParam()) // loop on each parameter 循环到每个参数
{
UART_CPutString(" <");
UART_PutString(strPtr); // Print each parameter 打印出每个参数
UART_CPutString(">\r\n");
}
}
UART_CmdReset(); // Reset command buffer 复位命令缓冲区
}
}
}
这个程序不知道是为什么,老出现这样的错误和警告:
!WF:\psoc练习\uart\uart\main.c(10):(361) function declared implicit int (warning)
!WF:\psoc练习\uart\uart\main.c(12):(361) function declared implicit int (warning)
!EF:\psoc练习\uart\uart\main.c(12):(192) undefined identifier "UART_ENABLE_RX_INT" (error)
!WF:\psoc练习\uart\uart\main.c(13):(361) function declared implicit int (warning)
!WF:\psoc练习\uart\uart\main.c(14):(361) function declared implicit int (warning)
!WF:\psoc练习\uart\uart\main.c(15):(361) function declared implicit int (warning)
!WF:\psoc练习\uart\uart\main.c(16):(361) function declared implicit int (warning)
!EF:\psoc练习\uart\uart\main.c(16):(192) undefined identifier "UART_PARITY_NONE" (error)
!WF:\psoc练习\uart\uart\main.c(18):(361) function declared implicit int (warning)
!WF:\psoc练习\uart\uart\main.c(21):(361) function declared implicit int (warning)
!WF:\psoc练习\uart\uart\main.c(23):(361) function declared implicit int (warning)
!WF:\psoc练习\uart\uart\main.c(23):(357) illegal conversion of integer to pointer (warning)
!WF:\psoc练习\uart\uart\main.c(26):(361) function declared implicit int (warning)
!WF:\psoc练习\uart\uart\main.c(28):(357) illegal conversion of integer to pointer (warning)
还请各位大侠帮忙解决一下吧。。。
谢谢了。。 |