Permalink
Browse files

Update Commit

- forgot to update get_serialconfig with new baudrate settings...
  • Loading branch information...
1 parent da96e66 commit 2deefce1a648e7a0e026f86c3fef01b3a18cbb9c @azman committed Nov 11, 2012
Showing with 30 additions and 11 deletions.
  1. +30 −11 src/my1comlib.c
View
41 src/my1comlib.c
@@ -334,19 +334,29 @@ int get_serialconfig(ASerialPort_t* aPort, ASerialConf_t* aConfig)
switch(aPort->mDCB.BaudRate)
{
case 19200:
- aConfig->mBaudRate = 1;
+ aConfig->mBaudRate = MY1BAUD19200;
break;
case 38400:
- aConfig->mBaudRate = 2;
+ aConfig->mBaudRate = MY1BAUD38400;
break;
case 57600:
- aConfig->mBaudRate = 3;
+ aConfig->mBaudRate = MY1BAUD57600;
break;
case 115200:
- aConfig->mBaudRate = 4;
+ aConfig->mBaudRate = MY1BAUD115200;
+ break;
+ case 230400:
+ aConfig->mBaudRate = MY1BAUD230400;
+ break;
+ case 460800:
+ aConfig->mBaudRate = MY1BAUD460800;
+ break;
+ case 921600:
+ aConfig->mBaudRate = MY1BAUD921600;
break;
default:
- aConfig->mBaudRate = 0;
+ case 9600:
+ aConfig->mBaudRate = MY1BAUD9600;
break;
}
aConfig->mByteSize = aPort->mDCB.ByteSize;
@@ -359,20 +369,29 @@ int get_serialconfig(ASerialPort_t* aPort, ASerialConf_t* aConfig)
switch(cBaudRate)
{
case B19200:
- aConfig->mBaudRate = 1;
+ aConfig->mBaudRate = MY1BAUD19200;
break;
case B38400:
- aConfig->mBaudRate = 2;
+ aConfig->mBaudRate = MY1BAUD38400;
break;
case B57600:
- aConfig->mBaudRate = 3;
+ aConfig->mBaudRate = MY1BAUD57600;
break;
case B115200:
- aConfig->mBaudRate = 4;
+ aConfig->mBaudRate = MY1BAUD115200;
+ break;
+ case B230400:
+ aConfig->mBaudRate = MY1BAUD230400;
+ break;
+ case B460800:
+ aConfig->mBaudRate = MY1BAUD460800;
+ break;
+ case B921600:
+ aConfig->mBaudRate = MY1BAUD921600;
break;
- case B9600:
default:
- aConfig->mBaudRate = 0;
+ case B9600:
+ aConfig->mBaudRate = MY1BAUD9600;
break;
}
cSizeFlag = aPort->mTIO.c_cflag & CSIZE;

0 comments on commit 2deefce

Please sign in to comment.