Subversion Repositories svnkaklik

Compare Revisions

Ignore whitespace Rev 876 → Rev 877

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