Changeset 215 in xtideuniversalbios for trunk/Serial_Server/library/Serial.cpp


Ignore:
Timestamp:
Jan 19, 2012, 9:17:04 AM (12 years ago)
Author:
gregli@…
google:author:
gregli@hotmail.com
Message:

More minor improvements to the serial server, in particular improved timeout recovery.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Serial_Server/library/Serial.cpp

    r210 r215  
    1212struct baudRate supportedBaudRates[] =
    1313{
    14     {   2400,  0x0,   "2400",   NULL },
    15     {   4800, 0xff,   "4800",   NULL },
    16     {   9600,  0x1,   "9600",   NULL },
    17     {  19200, 0xff,  "19.2K",  "19K" },
    18     {  38400,  0x2,  "38.4K",  "38K" },
    19     {  76800,  0x2,  "76.8K",  "77K" },
    20     { 115200,  0x3, "115.2K", "115K" },
    21     { 153600,  0x3, "153.6K", "154K" },
    22     { 230400, 0xff, "230.4K", "230K" },
    23     { 460800,  0x1, "460.8K", "460K" },
    24     {      0,    0,     NULL,   NULL }
     14    {   2400,  0x0,   "2400" },
     15    {   4800, 0xff,   "4800" },
     16    {   9600,  0x1,   "9600" },
     17    {  19200, 0xff,  "19.2K" },
     18    {  38400,  0x2,  "38.4K" },
     19    {  76800, 0xff,  "76.8K" },
     20    { 115200,  0x3, "115.2K" },
     21    { 153600, 0xff, "153.6K" },
     22    { 230400, 0xff, "230.4K" },
     23    { 460800, 0xff, "460.8K" },
     24    {      0,    0,     NULL }
    2525};
    2626
     
    3333    {
    3434        for( b = supportedBaudRates; b->rate; b++ )
    35             if( b->rate == a )
     35            if( b->rate == a || (b->rate / 1000) == a || ((b->rate + 500) / 1000) == a )
    3636                return( b );
    3737    }
    38 
    39     for( b = supportedBaudRates; b->rate; b++ )
    40         if( !stricmp( str, b->display ) || (b->altSelection && !stricmp( str, b->altSelection )) )
    41             return( b );
    4238
    4339    return( NULL );
Note: See TracChangeset for help on using the changeset viewer.