#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();
k=UART_2_cReadChar();
r=strstr(strPtr,"OK");
if(r)
{
LED_1_On();
LED_2_Off();
while(1){
UART_2_CPutString("at");
UART_2_PutCRLF();
}
}
}
再PSOC designer编译时r=strstr(strPtr,"OK");这句会出现什么pointer to_flash char 错误,求高手解答。 |