]> Zhao Yanbai Git Server - acecode.git/commitdiff
USART.md
authorAceVest <zhaoyanbai@126.com>
Mon, 3 Jun 2019 00:19:15 +0000 (08:19 +0800)
committerAceVest <zhaoyanbai@126.com>
Mon, 3 Jun 2019 00:19:15 +0000 (08:19 +0800)
learn/doc/mac_bash_profile
learn/stm32/USART.md [new file with mode: 0644]

index e123bb79074c036a7a99408dbc81ecad8b047745..6d3c43c21d7b70aa8e7823f69afedeb43247acfd 100644 (file)
@@ -11,7 +11,7 @@ export PATH=$PATH:/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin
 export PATH=$PATH:$HOME/Library/Arduino15/packages/arduino/tools/avrdude/6.0.1-arduino5/bin
 export PATH=$PATH:/usr/local/opt/go/libexec/bin
 #多个GOPATH用';'分隔 go get会存到第一个目录
-export GOPATH=$HOME/go:$HOME/workspace/web/qossvr/
+export GOPATH=$HOME/workspace/go:$HOME/workspace/web/qossvr/
 export RTOS_PATH=$HOME/workspace/acecode/rtos/
 
 RED="\[\033[01;31m\]"
diff --git a/learn/stm32/USART.md b/learn/stm32/USART.md
new file mode 100644 (file)
index 0000000..080af4f
--- /dev/null
@@ -0,0 +1,28 @@
+# USART
+
+
+# debug
+
+如果是用STM32CubeIDE生成的代码
+
+只需要在`usart.c`里添加如下几行
+
+```
+#include <stdio.h>
+#ifdef __GNUC__
+       #define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
+#else
+       #define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
+#endif
+PUTCHAR_PROTOTYPE
+{
+               HAL_UART_Transmit(&huart1 , (uint8_t *)&ch, 1, 0xFFFF);
+               return ch;
+}
+```
+
+生成代码的时候,选`USART1`,其它也可以,只是OneNetMiniBoard是`USART1`连到USB
+
+`Mode: Asynchronous`
+
+`Hadware Flow Control (RS233): Disable`
\ No newline at end of file