其中的us延时函数用while()循环实现:
void delay_us(uint32_t value)
{
uint32_t i;
i = value * 21;
while(i--);
}6.串口重定向实现如下:
int fputc(int ch, FILE *f)
{
/* Place your implementation of fputc here */
/* e.g. write a character to the EVAL_COM1 and Loop until the end of transmission */
HAL_UART_Transmit(&huart6, (uint8_t *)&ch, 1, 0xFFFF);