File tree Expand file tree Collapse file tree 2 files changed +16
-25
lines changed Expand file tree Collapse file tree 2 files changed +16
-25
lines changed Original file line number Diff line number Diff line change @@ -329,25 +329,27 @@ class SerialBase : private NonCopyable<SerialBase> {
329
329
330
330
#if DEVICE_SERIAL_ASYNCH
331
331
CThunk<SerialBase> _thunk_irq;
332
- DMAUsage _tx_usage;
333
- DMAUsage _rx_usage;
332
+ DMAUsage _tx_usage = DMA_USAGE_NEVER ;
333
+ DMAUsage _rx_usage = DMA_USAGE_NEVER ;
334
334
event_callback_t _tx_callback;
335
335
event_callback_t _rx_callback;
336
- bool _tx_asynch_set;
337
- bool _rx_asynch_set;
336
+ bool _tx_asynch_set = false ;
337
+ bool _rx_asynch_set = false ;
338
338
#endif
339
- #if DEVICE_SERIAL_FC
340
- Flow _flow_type;
341
- PinName _flow1;
342
- PinName _flow2;
343
- #endif
344
- serial_t _serial;
339
+ serial_t _serial {};
345
340
Callback<void ()> _irq[IrqCnt];
346
341
int _baud;
347
- bool _rx_enabled;
348
- bool _tx_enabled;
342
+ bool _rx_enabled = true ;
343
+ bool _tx_enabled = true ;
349
344
const PinName _tx_pin;
350
345
const PinName _rx_pin;
346
+
347
+ #if DEVICE_SERIAL_FC
348
+ Flow _flow_type = Disabled;
349
+ PinName _flow1 = NC;
350
+ PinName _flow2 = NC;
351
+ #endif
352
+
351
353
#endif
352
354
};
353
355
Original file line number Diff line number Diff line change @@ -25,21 +25,10 @@ namespace mbed {
25
25
26
26
SerialBase::SerialBase (PinName tx, PinName rx, int baud) :
27
27
#if DEVICE_SERIAL_ASYNCH
28
- _thunk_irq (this ), _tx_usage(DMA_USAGE_NEVER),
29
- _rx_usage(DMA_USAGE_NEVER), _tx_callback(NULL ),
30
- _rx_callback(NULL ), _tx_asynch_set(false ),
31
- _rx_asynch_set(false ),
28
+ _thunk_irq (this ),
32
29
#endif
33
- #if DEVICE_SERIAL_FC
34
- _flow_type (Disabled),
35
- _flow1(NC),
36
- _flow2(NC),
37
- #endif
38
- _serial (),
39
30
_baud (baud),
40
- _rx_enabled (true ),
41
- _tx_enabled (true ),
42
- _tx_pin (tx),
31
+ _tx_pin (tx),
43
32
_rx_pin (rx)
44
33
{
45
34
// No lock needed in the constructor
You can’t perform that action at this time.
0 commit comments