madtoilet
Joined: 02 Apr 2008 Posts: 36
|
rs232 conflicts |
Posted: Tue Apr 15, 2008 2:37 pm |
|
|
i have the following setting:
Code: |
#use rs232(baud=4800, bits=8, parity=N, stop=1, xmit=PIN_C6, rcv=PIN_C7, stream=GSM, ERRORS)
|
but when i use the follow functions:
Code: |
void my_get_string(void) {
char c;
int i=4;
int count=0;
unsigned char temp[68]="$GPR";
output_low(PIN_B7);
delay_ms(500);
start:
c = getc();
if(c == '$')
{
output_high(PIN_B7);
output_low(PIN_B7);
c = getc();
if(c == 'G'){
// output_low(PIN_B7);
output_high(PIN_B7);
//output_low(PIN_B7);
c = getc();
if (c == 'P'){
c = getc();
if (c == 'R'){
output_high(PIN_B7);
while(count < 55){
temp[i]= getc();
i++;
count++;
}
goto ending;
/*
back:
output_high(PIN_B7);
goto back;*/
}
}
}
}
goto start;
ending:
temp[i] = 0;
cursor_position(0x81);
out_lcd_string(temp);
delay_ms(1500);
}
|
and
Code: | void gsm_call(void)
{
char c;
output_low(PIN_B5);
delay_ms(800);
output_low(PIN_C4);
output_high(PIN_C5);
delay_ms(500);
fprintf(GSM, "AT+CMGF=1\r\n");
delay_ms(2050);
fprintf(GSM,"AT+CMGS=\"%s\"\r\n",num);
delay_ms(2000);
fprintf(GSM, "check\r\n");
fputc(0x1A,GSM);
delay_ms(3000);
}
|
the my_get_string function stops working but the gsm_call continues to work correctly.
however, when i comment stream=GSM out of the configuration, the my_get_string works.
Is there a reason that this is happening? |
|