Subversion Repositories svnkaklik

Compare Revisions

Ignore whitespace Rev 877 → Rev 876

/programy/C/PIC/test/PIC16F887/sscanf/main.c
105,7 → 105,7
}
 
c = toupper(c);
while (true)
while ( 1 )
{
if (c >= '0' && c <= '9')
result = (result << 4) + (c - '0');
187,7 → 187,7
int1 sign;
char *endptr;
 
while (true)
while (1)
{
/* Look to see if we are out of arguments */
if ( !pArgs )
305,7 → 305,7
p = (char *)(*pArgs);
 
/* copy the chars */
while (true)
while (1)
{
if ((isspace(*buf)) || (!*buf))
{
369,12 → 369,8
char x;
char sbuffer[64];
char cmd=0,param=0;
char arglist[2];
arglist[0] = &cmd;
arglist[1] = &param;
long l;
 
 
set_tris_a(0x80);
port_b_pullups(0xFF);
set_tris_b(0xFF);
391,8 → 387,8
set_pwm1_duty(75);
setup_comparator(NC_NC_NC_NC);
 
sprintf(sbuffer,"/S 30\r\n");
x = sscanf(sbuffer,"/%C %d", arglist);
printf("\r\nsscanf sez: %u found, cmd %X param %X\r\n",x,cmd,param);
sprintf(sbuffer,"/S30\n\");
x = sscanf(sbuffer,"/%C%d", &cmd, &param);
printf("\n\rsscanf sez: %u found, cmd %X param %X\n\r",x,cmd,param);
 
}