未验证 提交 dd5178ef 编写于 作者: B Bernard Xiong 提交者: GitHub

Merge pull request #3352 from z14git/serial_bug_fix

修复因串口接收缓冲区满且没有开启ULOG_USING_ISR_LOG而造成的死机问题
...@@ -330,14 +330,16 @@ rt_inline int _serial_int_tx(struct rt_serial_device *serial, const rt_uint8_t * ...@@ -330,14 +330,16 @@ rt_inline int _serial_int_tx(struct rt_serial_device *serial, const rt_uint8_t *
static void _serial_check_buffer_size(void) static void _serial_check_buffer_size(void)
{ {
static rt_bool_t already_output = RT_FALSE; static rt_bool_t already_output = RT_FALSE;
if (already_output == RT_FALSE) if (already_output == RT_FALSE)
{ {
#if !defined(RT_USING_ULOG) || defined(ULOG_USING_ISR_LOG)
LOG_W("Warning: There is no enough buffer for saving data," LOG_W("Warning: There is no enough buffer for saving data,"
" please increase the RT_SERIAL_RB_BUFSZ option."); " please increase the RT_SERIAL_RB_BUFSZ option.");
#endif
already_output = RT_TRUE; already_output = RT_TRUE;
} }
} }
#if defined(RT_USING_POSIX) || defined(RT_SERIAL_USING_DMA) #if defined(RT_USING_POSIX) || defined(RT_SERIAL_USING_DMA)
static rt_size_t _serial_fifo_calc_recved_len(struct rt_serial_device *serial) static rt_size_t _serial_fifo_calc_recved_len(struct rt_serial_device *serial)
...@@ -1286,4 +1288,3 @@ void rt_hw_serial_isr(struct rt_serial_device *serial, int event) ...@@ -1286,4 +1288,3 @@ void rt_hw_serial_isr(struct rt_serial_device *serial, int event)
#endif /* RT_SERIAL_USING_DMA */ #endif /* RT_SERIAL_USING_DMA */
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册