用PSOC向MC55发送指令的程序:
#include <m8c.h>
// part specific constants and macros
#include "PSoCAPI.h"
// PSoC API definitions for all User Modules
#include <string.h>
void main(void)
{int i;
char *r;
char k;
char
*strPtr;// Parameter pointer
unsigned char AT_Buffer[9];
unsigned char Command_AT[3] ={0x41,0x54,0x0D};
UART_2_CmdReset(); // Initialize receiver/cmd
UART_2_EnableInt(); // Enable RX interrupts
Counter8_1_WritePeriod(155); // Set up baud rate generator
Counter8_1_WriteCompareValue(77);
Counter8_1_Start(); // Turn on baud rate generator
UART_2_Start(UART_2_PARITY_NONE); // Enable UART
M8C_EnableGInt ; // Turn on interrupts
LED_1_Start();
LED_2_Start();
LED_1_Off();
LED_2_Off();
UART_2_CPutString("AT");
UART_2_PutCRLF();
strPtr = UART_2_szGetParam();
r=strstr(strPtr,"OK");
if(r)
{
LED_1_On();
LED_2_Off();
while(1){
UART_2_CPutString("ATD15120077266;");
UART_2_PutCRLF();
}
}
}
错误提示:!E C:\Users\wsy\DOCUME~1\PSOCDE~1.0PR\uart_1\uart_1\main.c(62): type error in argument 2 to `strstr'; found `pointer to __flash char' expected `pointer to char'
什么意思啊? |