Changeset 215 in xtideuniversalbios for trunk/Serial_Server/library/Serial.cpp
- Timestamp:
- Jan 19, 2012, 9:17:04 AM (13 years ago)
- google:author:
- gregli@hotmail.com
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Serial_Server/library/Serial.cpp
r210 r215 12 12 struct baudRate supportedBaudRates[] = 13 13 { 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 } 25 25 }; 26 26 … … 33 33 { 34 34 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 ) 36 36 return( b ); 37 37 } 38 39 for( b = supportedBaudRates; b->rate; b++ )40 if( !stricmp( str, b->display ) || (b->altSelection && !stricmp( str, b->altSelection )) )41 return( b );42 38 43 39 return( NULL );
Note:
See TracChangeset
for help on using the changeset viewer.