Changeset 233 in xtideuniversalbios for trunk/Serial_Server/win32/Win32.cpp


Ignore:
Timestamp:
Feb 4, 2012, 6:21:22 PM (12 years ago)
Author:
gregli@…
google:author:
gregli@hotmail.com
Message:

Serial Port: split single byte port and baud into two bytes, taking advantage of the two bytes in DPT_SERIAL, which supports more serial baud rates and in particular fixed a bug where a 4x client machine couldn't talk to a 115.2K server machine. This is a wide change, touching lots of files, but most are shallow changes. DetectPrint.asm took the most significant changes, now it calculates the baud rate to display instead of using characters provided by the Configurator. The Configurator now has a new menu flag, FLG_MENUITEM_CHOICESTRINGS, for specifying that values are not linear and they should be lookedup rather than indexed. Finally, another important bug fixed here is that in some error cases, the serial port code could get into an infinite loop waiting ont the hardware; now it has a timeout.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Serial_Server/win32/Win32.cpp

    r225 r233  
    3232        "                      (default is a 32 MB disk, with CHS geometry 65:63:16)",
    3333        "",
    34         "  -p                  Named Pipe mode for emulators (pipe is '" PIPENAME "')",
     34        "  -p                  Named Pipe mode for emulators (pipe is \"" PIPENAME "\")",
    3535        "",
    3636        "  -c COMPortNumber    COM Port to use (default is first found)",
    3737        "",
    38         "  -b BaudRate         Baud rate to use on the COM port ",
    39         "                      Without a rate multiplier: 2400, 9600, 38400, 115200",
    40         "                      With a 2x rate multiplier: 4800, 19200, 76800, 230400",
    41         "                      With a 4x rate multiplier: 9600, 38400, 153600, 460800",
    42         "                      Abbreviations also accepted (ie, '460K', '38.4K', etc)",
    43         "                      (default is 38400, 115200 in named pipe mode)",
     38        "  -b BaudRate         Baud rate to use on the COM port, with client machine",
     39        "                      rate multiplier in effect:",
     40        "                          None:  2400,  4800,  9600,  28.8K,  57.6K, 115.2K",
     41        "                          2x:    4800,  9600, 19200,  57.6K, 115.2K, 230.4K",
     42        "                          4x:    9600, 19200, 38400, 115.2K, 230.4K, 460.8K",
     43        "                          and for completeness:               76.8K, 153.6K",
     44        "                      (default is 9600, 115.2K when in named pipe mode)",
    4445        "",
    4546        "  -t                  Disable timeout, useful for long delays when debugging",
     
    148149                break;
    149150            case 'b': case 'B':
    150                 if( !(baudRate = baudRateMatchString( argv[++t] )) )
    151                 {
    152                     fprintf( stderr, "Unknown Baud Rate %s\n\n", argv[t] );
    153                     usage();
    154                 }
     151                if( !(baudRate = baudRateMatchString( argv[++t] )) || !baudRate->rate )
     152                    log( -2, "Unknown Baud Rate \"%s\"", argv[t] );
    155153                break;
    156154            default:
    157                 fprintf( stderr, "Unknown Option: %s\n\n", argv[t] );
    158                 usage();
     155                log( -2, "Unknown Option: \"%s\"", argv[t] );
    159156            }
    160157        }
     
    179176
    180177    if( !baudRate )
    181         baudRate = baudRateMatchString( "38400" );
     178        baudRate = baudRateMatchString( "9600" );
    182179
    183180    do
     
    206203        vfprintf( stderr, message, args );
    207204        fprintf( stderr, "\n" );
     205        if( level < -1 )
     206        {
     207            fprintf( stderr, "\n" );
     208            usage();
     209        }
    208210        exit( 1 );
    209211    }
Note: See TracChangeset for help on using the changeset viewer.