feat: 移植 lwprintf
This commit is contained in:
23
project/src/by_debug.c
Normal file
23
project/src/by_debug.c
Normal file
@@ -0,0 +1,23 @@
|
||||
#include "by_debug.h"
|
||||
|
||||
#include "at32f403a_407.h"
|
||||
#include "lwprintf.h"
|
||||
|
||||
int lwprintf_out(int ch, lwprintf_t *lwp)
|
||||
{
|
||||
|
||||
/* May use printf to output it for test */
|
||||
|
||||
if (ch != '\0') {
|
||||
while (usart_flag_get(BY_DEBUG_USART_INDEX, USART_TDC_FLAG) == RESET)
|
||||
;
|
||||
usart_data_transmit(BY_DEBUG_USART_INDEX, (char)ch);
|
||||
}
|
||||
|
||||
return ch;
|
||||
}
|
||||
|
||||
void by_debug_init(void)
|
||||
{
|
||||
lwprintf_init(lwprintf_out);
|
||||
}
|
||||
Reference in New Issue
Block a user