Sfoglia il codice sorgente

Fx out to serial. Add polling.

Vladimir N. Shilov 2 anni fa
parent
commit
9b8da01b55
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  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 ++; } \
 }
 
 /**