Skip to content

Commit 9f2ce58

Browse files
committed
[serial_v2]modify the default configuration of the RT_SERIAL_CONFIG_DEFAULT structure to support parameters in the absence of DMA configuration.
1 parent 8a7ef41 commit 9f2ce58

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

components/drivers/include/drivers/dev_serial_v2.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@
225225
#define RT_SERIAL_FLOWCONTROL_NONE 0
226226

227227
/* Default config for serial_configure structure */
228+
#ifdef RT_SERIAL_USING_DMA
228229
#define RT_SERIAL_CONFIG_DEFAULT \
229230
{ \
230231
BAUD_RATE_115200, /* 115200 bits/s */ \
@@ -239,6 +240,21 @@
239240
0, /* reserved */ \
240241
0, /* dma_ping_bufsz */ \
241242
}
243+
#else
244+
#define RT_SERIAL_CONFIG_DEFAULT \
245+
{ \
246+
BAUD_RATE_115200, /* 115200 bits/s */ \
247+
DATA_BITS_8, /* 8 databits */ \
248+
STOP_BITS_1, /* 1 stopbit */ \
249+
PARITY_NONE, /* No parity */ \
250+
BIT_ORDER_LSB, /* LSB first sent */ \
251+
NRZ_NORMAL, /* Normal mode */ \
252+
RT_SERIAL_RX_MINBUFSZ, /* rxBuf size */ \
253+
RT_SERIAL_TX_MINBUFSZ, /* txBuf size */ \
254+
RT_SERIAL_FLOWCONTROL_NONE, /* Off flowcontrol */ \
255+
0, /* reserved */ \
256+
}
257+
#endif
242258

243259
/**
244260
* @brief Serial receive indicate hook function type

0 commit comments

Comments
 (0)