Modified mbed library sources only for STM32F030K6, LQFP32 (0.8mm pitch) package, 32K Flash, 4K SRAM. Compiler target: Nucleo 32F030R8
Fork of mbed-src by
Diff: common/SerialBase.cpp
- Revision:
- 212:34d62c0b2af6
- Parent:
- 192:42b1a45e48aa
- Child:
- 525:c320967f86b9
diff -r fb8edfff6ae1 -r 34d62c0b2af6 common/SerialBase.cpp --- a/common/SerialBase.cpp Sun May 25 08:00:07 2014 +0100 +++ b/common/SerialBase.cpp Mon May 26 18:15:07 2014 +0100 @@ -20,9 +20,8 @@ namespace mbed { -SerialBase::SerialBase(PinName tx, PinName rx) { +SerialBase::SerialBase(PinName tx, PinName rx) : _serial(), _baud(9600) { serial_init(&_serial, tx, rx); - _baud = 9600; serial_irq_handler(&_serial, SerialBase::_irq_handler, (uint32_t)this); } @@ -71,7 +70,7 @@ // Wait for 1.5 frames before clearing the break condition // This will have different effects on our platforms, but should // ensure that we keep the break active for at least one frame. - // We consider a full frame (1 start bit + 8 data bits bits + + // We consider a full frame (1 start bit + 8 data bits bits + // 1 parity bit + 2 stop bits = 12 bits) for computation. // One bit time (in us) = 1000000/_baud // Twelve bits: 12000000/baud delay @@ -88,16 +87,16 @@ case RTS: serial_set_flow_control(&_serial, flow_type, flow1, NC); break; - + case CTS: serial_set_flow_control(&_serial, flow_type, NC, flow1); break; - + case RTSCTS: case Disabled: serial_set_flow_control(&_serial, flow_type, flow1, flow2); break; - + default: break; }