#include #include #include "board.h" #include "main.h" #include "usart.h" /** * @brief printf 重定向 * * @param ch * @param stream * @return int */ int fputc(int ch, FILE* stream) { uint8_t c = ch; HAL_UART_Transmit(&DEBUG_UART, &c, 1, 100); return ch; } /** * @brief ticket辅助方法 */ uint32_t port_haspassedms(uint32_t ticket) { uint32_t nowticket = HAL_GetTick(); if (nowticket >= ticket) { return nowticket - ticket; } return UINT32_MAX - ticket + nowticket; }