Changeset 817

Show
Ignore:
Timestamp:
08/13/08 13:08:25 (3 months ago)
Author:
liamstask
Message:

- small cleanup

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • firmware/trunk/libraries/xbee/xbee.c

    r812 r817  
    225225  do 
    226226  { 
    227     if( Serial_GetErrors( 0, 0, 0 ) ) 
    228       Serial_ClearErrors(); 
    229  
     227    Serial_ClearErrors(); 
    230228    while( Serial_GetReadable( ) ) 
    231229    { 
     
    233231      if( newChar == -1 ) 
    234232        break; 
    235    
    236       // should really have a watchdog to reset the parser if it goes haywire 
    237233   
    238234      switch( packet->rxState ) 
     
    391387  { 
    392388    char buf[50]; 
    393     snprintf( buf, 50, "+++" ); // enter command mode 
     389    sprintf( buf, "+++" ); // enter command mode 
    394390    Serial_Write( (uchar*)buf, strlen(buf), 0 ); 
    395391    Sleep( 1025 ); // have to wait one second after +++ to actually get set to receive in AT mode 
    396     snprintf( buf, 50, "ATAP %x,CN\r", 1 ); // turn API mode on, and leave command mode 
     392    sprintf( buf, "ATAP1,CN\r" ); // turn API mode on, and leave command mode 
    397393    Serial_Write( (uchar*)buf, strlen(buf), 0 ); 
     394    Sleep(50); 
     395    Serial_Flush(); // rip the OKs out of there 
    398396  } 
    399397  else