uart增加发送字符串的功能

This commit is contained in:
fslongjin 2022-08-03 14:52:42 +08:00
parent de3324ed7d
commit 8325799657
2 changed files with 29 additions and 2 deletions

View File

@ -86,3 +86,22 @@ uchar uart_read(uint32_t port)
return io_in8(port);
}
/**
* @brief
*
* @param port
* @param str
*/
void uart_send_str(uint32_t port, const char *str)
{
if ((unlikely(str == NULL)))
return;
while (1)
{
if (unlikely(*str == '\0'))
return;
uart_send(port, *str);
++str;
}
}

View File

@ -62,3 +62,11 @@ void uart_send(uint32_t port, char c);
* @return uchar
*/
uchar uart_read(uint32_t port);
/**
* @brief
*
* @param port
* @param str
*/
void uart_send_str(uint32_t port, const char *str);