Ver código fonte

Fx out to serial. Add polling.

Vladimir N. Shilov 2 anos atrás
pai
commit
9b8da01b55
1 arquivos alterados com 3 adições e 1 exclusões
  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 ++; } \
 }
 
 /**