Changeset 233 in xtideuniversalbios for trunk/Serial_Server/library/Image.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/library/Image.cpp

    r219 r233  
    137137#define ATA_dwLBACnt 60
    138138
    139 #define ATA_VendorSpecific_ReturnPortBaud 158
     139#define ATA_wVendor 159
    140140
    141141#define ATA_wCaps_LBA 0x200
     
    164164};
    165165
    166 void Image::respondInquire( unsigned short *buff, struct baudRate *baudRate, unsigned char portAndBaud )
    167 {
    168     unsigned short comPort = 0;
    169     struct comPorts *cp;
    170 
    171     if( portAndBaud )
    172     {
    173         for( cp = supportedComPorts; cp->port && cp->port != ((portAndBaud << 3) + 0x260); cp++ ) ;
    174         if( cp->port )
    175             comPort = cp->com;
    176     }
    177      
     166void Image::respondInquire( unsigned short *buff, struct baudRate *baudRate, unsigned short port, unsigned char scan )
     167{
    178168    memset( &buff[0], 0, 514 );
    179169
    180     if( comPort )
    181         sprintf( (char *) &buff[ATA_strModel], "%.20s (COM%d/%s)", shortFileName, comPort, baudRate->display );
    182     else
    183         sprintf( (char *) &buff[ATA_strModel], "%.30s (%s baud)", shortFileName, baudRate->display );
    184 
    185     // strncpy( (char *) &buff[ATA_strModel], img->shortFileName, 40 );
     170    if( scan )
     171    {
     172        unsigned short comPort = 0;
     173        struct comPorts *cp;
     174
     175        if( port )
     176        {
     177            for( cp = supportedComPorts; cp->port && cp->port != port; cp++ ) ;
     178            if( cp->port )
     179                comPort = cp->com;
     180        }
     181
     182        if( comPort )
     183            sprintf( (char *) &buff[ATA_strModel], "%.15s (COM%c/%s)", shortFileName, comPort, baudRate->display );
     184        else
     185            sprintf( (char *) &buff[ATA_strModel], "%.25s (%s baud)", shortFileName, baudRate->display );
     186    }
     187    else
     188        sprintf( (char *) &buff[ATA_strModel], "%.30s", shortFileName );
    186189
    187190    strncpy( (char *) &buff[ATA_strSerial], "serial", 20 );
Note: See TracChangeset for help on using the changeset viewer.