fix delay ms & delay 10us

This commit is contained in:
2025-08-13 20:15:17 +08:00
parent 0939eae851
commit 17413f4cc2
4 changed files with 83 additions and 87 deletions

View File

@@ -56,11 +56,16 @@ int main(void)
led_init();
printf("Hello USART0!");
// 移除led_off()调用让心跳函数控制LED
char hello_world[] = {"Hello World!"};
for (uint8_t i = 0; i < sizeof(hello_world); i++)
{
while (usart_flag_get(RS485_PHY, USART_FLAG_TBE) == RESET) {}
usart_data_transmit(RS485_PHY, hello_world[i]);
}
while (usart_flag_get(RS485_PHY, USART_FLAG_TC) == RESET) {}
while(1){
// 使用不会干扰SysTick中断的安全延时函数
delay_ms_safe(100);
command_process();
}
}