فهرست منبع

Fx out to serial. Add polling.

Vladimir N. Shilov 2 سال پیش
والد
کامیت
9b8da01b55
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 3 1
      cfg/chconf.h

+ 3 - 1
cfg/chconf.h

@@ -810,7 +810,9 @@
  */
 #define CH_CFG_SYSTEM_HALT_HOOK(reason) {                                   \
   /* System halt code here.*/                                               \
-  while (*reason) { USART_DR_DR = *reason; reason ++; } \
+  while (*reason) { \
+    while ((USART1->SR & USART_SR_TXE) == 0) { __NOP(); } \
+    USART1->DR = *reason; reason ++; } \
 }
 
 /**