Subversion Repositories svnkaklik

Rev

Rev 876 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log

Rev 876 Rev 877
Line 103... Line 103...
103
      s += 2;
103
      s += 2;
104
      c = *s;
104
      c = *s;
105
    }
105
    }
106
 
106
 
107
    c = toupper(c);
107
    c = toupper(c);
108
    while ( 1 )
108
    while (true)
109
    {
109
    {
110
      if (c >= '0' && c <= '9')
110
      if (c >= '0' && c <= '9')
111
        result = (result << 4) + (c - '0');
111
        result = (result << 4) + (c - '0');
112
      else if (c >= 'A' && c <='F')
112
      else if (c >= 'A' && c <='F')
113
        result = (result << 4) + (c - 'A' + 10);
113
        result = (result << 4) + (c - 'A' + 10);
Line 185... Line 185...
185
  char        *p;
185
  char        *p;
186
  int1        size_long;
186
  int1        size_long;
187
  int1        sign;
187
  int1        sign;
188
  char        *endptr;
188
  char        *endptr;
189
 
189
 
190
  while (1)
190
  while (true)
191
  {
191
  {
192
   /* Look to see if we are out of arguments */
192
   /* Look to see if we are out of arguments */
193
   if ( !pArgs )
193
   if ( !pArgs )
194
     return( count );
194
     return( count );
195
 
195
 
Line 303... Line 303...
303
      case 's':
303
      case 's':
304
        /* Get a pointer to this argument */
304
        /* Get a pointer to this argument */
305
        p = (char *)(*pArgs);
305
        p = (char *)(*pArgs);
306
 
306
 
307
        /* copy the chars */
307
        /* copy the chars */
308
        while (1)
308
        while (true)
309
        {
309
        {
310
          if ((isspace(*buf)) || (!*buf))
310
          if ((isspace(*buf)) || (!*buf))
311
          {
311
          {
312
            *p = 0;
312
            *p = 0;
313
            break;
313
            break;
Line 367... Line 367...
367
 
367
 
368
void main() {
368
void main() {
369
    char x;
369
    char x;
370
    char sbuffer[64];
370
    char sbuffer[64];
371
    char cmd=0,param=0;
371
    char cmd=0,param=0;
372
    long l;
372
    
-
 
373
    char arglist[2];
-
 
374
   arglist[0] = &cmd;   
-
 
375
   arglist[1] = &param;
-
 
376
 
373
 
377
 
374
    set_tris_a(0x80);
378
    set_tris_a(0x80);
375
    port_b_pullups(0xFF);
379
    port_b_pullups(0xFF);
376
    set_tris_b(0xFF);
380
    set_tris_b(0xFF);
377
    set_tris_d(0);
381
    set_tris_d(0);
Line 385... Line 389...
385
    setup_timer_2(T2_DIV_BY_16, 155, 1);
389
    setup_timer_2(T2_DIV_BY_16, 155, 1);
386
    setup_ccp1(CCP_PWM);
390
    setup_ccp1(CCP_PWM);
387
    set_pwm1_duty(75);
391
    set_pwm1_duty(75);
388
    setup_comparator(NC_NC_NC_NC);
392
    setup_comparator(NC_NC_NC_NC);
389
 
393
 
390
sprintf(sbuffer,"/S30\n\");
394
sprintf(sbuffer,"/S 30\r\n");
391
x = sscanf(sbuffer,"/%C%d", &cmd, &param);
395
x = sscanf(sbuffer,"/%C %d", arglist);
392
printf("\n\rsscanf sez: %u found, cmd %X param %X\n\r",x,cmd,param);
396
printf("\r\nsscanf sez: %u found, cmd %X param %X\r\n",x,cmd,param);
393
 
397
 
394
} 
398
}