Skip to content

Commit cb53825

Browse files
authored
Merge pull request #12282 from mprse/fix_for_issue_12268
Fix for issue #12268 (SerialBase.cpp: fix initialization list)
2 parents 34a291b + f4af051 commit cb53825

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/source/SerialBase.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,28 @@
2424
namespace mbed {
2525

2626
SerialBase::SerialBase(PinName tx, PinName rx, int baud) :
27+
_init_func(&SerialBase::_init),
2728
#if DEVICE_SERIAL_ASYNCH
2829
_thunk_irq(this),
2930
#endif
3031
_baud(baud),
3132
_tx_pin(tx),
32-
_rx_pin(rx),
33-
_init_func(&SerialBase::_init)
33+
_rx_pin(rx)
3434
{
3535
// No lock needed in the constructor
3636

3737
(this->*_init_func)();
3838
}
3939

4040
SerialBase::SerialBase(const serial_pinmap_t &static_pinmap, int baud) :
41+
_init_func(&SerialBase::_init_direct),
4142
#if DEVICE_SERIAL_ASYNCH
4243
_thunk_irq(this),
4344
#endif
4445
_baud(baud),
4546
_tx_pin(static_pinmap.tx_pin),
4647
_rx_pin(static_pinmap.rx_pin),
47-
_static_pinmap(&static_pinmap),
48-
_init_func(&SerialBase::_init_direct)
48+
_static_pinmap(&static_pinmap)
4949
{
5050
// No lock needed in the constructor
5151

0 commit comments

Comments
 (0)