Skip to content

Commit 95b1d69

Browse files
wdfk-progRbb666
authored andcommitted
[serial_v2]modify the default configuration of the RT_SERIAL_CONFIG_DEFAULT structure to support parameters in the absence of DMA configuration.
1 parent 44dbb4e commit 95b1d69

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

components/drivers/include/drivers/dev_serial_v2.h

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,22 @@
225225
#define RT_SERIAL_FLOWCONTROL_NONE 0
226226

227227
/* Default config for serial_configure structure */
228+
#ifdef RT_SERIAL_USING_DMA
229+
#define RT_SERIAL_CONFIG_DEFAULT \
230+
{ \
231+
BAUD_RATE_115200, /* 115200 bits/s */ \
232+
DATA_BITS_8, /* 8 databits */ \
233+
STOP_BITS_1, /* 1 stopbit */ \
234+
PARITY_NONE, /* No parity */ \
235+
BIT_ORDER_LSB, /* LSB first sent */ \
236+
NRZ_NORMAL, /* Normal mode */ \
237+
RT_SERIAL_RX_MINBUFSZ, /* rxBuf size */ \
238+
RT_SERIAL_TX_MINBUFSZ, /* txBuf size */ \
239+
RT_SERIAL_FLOWCONTROL_NONE, /* Off flowcontrol */ \
240+
0, /* reserved */ \
241+
RT_SERIAL_RX_MINBUFSZ / 2, /* dma_ping_bufsz */ \
242+
}
243+
#else
228244
#define RT_SERIAL_CONFIG_DEFAULT \
229245
{ \
230246
BAUD_RATE_115200, /* 115200 bits/s */ \
@@ -237,8 +253,8 @@
237253
RT_SERIAL_TX_MINBUFSZ, /* txBuf size */ \
238254
RT_SERIAL_FLOWCONTROL_NONE, /* Off flowcontrol */ \
239255
0, /* reserved */ \
240-
0, /* dma_ping_bufsz */ \
241256
}
257+
#endif
242258

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

0 commit comments

Comments
 (0)