|
|
View previous topic :: View next topic |
Author |
Message |
Guest Guest
|
strstr works on 3,225 but on 3.245 not |
Posted: Sat Mar 18, 2006 8:28 am |
|
|
Hi,
Anybody now why this code work compiled with 3.225, but 3.245 not !?!
I use this on 18F2620, Mplab 7.31
Code: |
strcpy(buff1, "ende");
printf("Start \r");
while( TRUE ){
gets(buffer);
if( strstr(buffer, buff1) )
break;
printf("---> %s\r", buffer);
}
printf("Ende Test\r"); |
|
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Mar 18, 2006 12:50 pm |
|
|
Quote: |
Anybody now why this code work compiled with 3.225, but 3.245 not !?!
I use this on 18F2620, Mplab 7.31
|
You didn't post a test program so I made one. I compiled it with
PCH vs. 3.245.
I don't have your hardware so I used the MPLAB simulator (vs. 7.20).
I commented out the gets() line, and instead I loaded the "buffer"
array with a string.
The following program works OK in the MPLAB simulator using
"UART1" to display RS-232 output in the Output Window.
It displays this:
Code: | #include <18F2620.H>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock=4000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)
#include <string.h>
void main()
{
char buff1[50];
char buffer[50];
strcpy(buff1, "ende");
strcpy(buffer, "This is a test ende"); // Added this line.
printf("Start \r");
while( TRUE ){
//gets(buffer);
if( strstr(buffer, buff1) )
break;
printf("---> %s\r", buffer);
}
printf("Ende Test\r");
while(1);
} |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|