2026-02-03 09:49:58 +00:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include "usart.h"
|
|
|
|
|
#include "log.h"
|
|
|
|
|
#include "main.h"
|
|
|
|
|
|
|
|
|
|
static char _dbg_TXBuff[128];
|
|
|
|
|
|
|
|
|
|
void _dbg_printf(const char *format, ...)
|
|
|
|
|
{
|
|
|
|
|
uint32_t length;
|
|
|
|
|
va_list args;
|
|
|
|
|
|
|
|
|
|
va_start(args, format);
|
|
|
|
|
length = vsnprintf((char *)_dbg_TXBuff, sizeof(_dbg_TXBuff), (char *)format, args);
|
|
|
|
|
va_end(args);
|
|
|
|
|
|
2026-02-26 01:48:55 +00:00
|
|
|
// HAL_UART_Transmit_DMA(&huart1, (uint8_t *)_dbg_TXBuff, length);
|
2026-02-03 09:49:58 +00:00
|
|
|
HAL_UART_Transmit(&huart1, (uint8_t *)_dbg_TXBuff, length, 1000);
|
|
|
|
|
}
|
|
|
|
|
|