[Kernel] message 可以返回消息的实际大小 (#7709)

This commit is contained in:
zhkag
2023-06-21 18:22:42 +08:00
committed by GitHub
parent b4e59bac4e
commit 33f550cb65
18 changed files with 73 additions and 56 deletions
+1 -1
View File
@@ -575,7 +575,7 @@ static void serial_thread_entry(void *parameter)
rt_memset(&msg, 0, sizeof(msg));
/* Read messages from the message queue*/
result = rt_mq_recv(&rx_mq, &msg, sizeof(msg), RT_WAITING_FOREVER);
if (result == RT_EOK)
if (result >= 0)
{
/*Read data from the serial port*/
rx_length = rt_device_read(msg.dev, 0, rx_buffer, msg.size);