From dca9d1109b42085df12402d6b54006a23a9aaa75 Mon Sep 17 00:00:00 2001 From: guanjiao <sqrgj@163.com> Date: 星期日, 07 十月 2018 16:35:01 +0800 Subject: [PATCH] 修改为0.5s通讯一次,增加测距输出 --- 源码/核心板/Src/OnChipDevices/Usart.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/OnChipDevices/Usart.c" "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/OnChipDevices/Usart.c" index 6ed2bf7..7ed8dde 100644 --- "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/OnChipDevices/Usart.c" +++ "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/OnChipDevices/Usart.c" @@ -1,5 +1,6 @@ #include "Usart.h" #include <string.h> +#include <stdio.h> //数据发送队列变量 EUART_Frame m_EUART_TxFrames[EUART_TX_FRM_SIZE]; //数据发送帧队列 @@ -288,3 +289,11 @@ m_EUART_TxFrm_FreeFrmLen++; } +int fputc(int ch, FILE *f) +{ + + USART_SendData(USART1, (unsigned char) ch);// USART1 ???? USART2 ? + while (!(USART1->SR & USART_FLAG_TXE)); + return (ch); +} + -- Gitblit v1.9.3