From bbb68fd93739963f866d0c95246191962b6a7f72 Mon Sep 17 00:00:00 2001
From: zhyinch <zhyinch@gmail.com>
Date: 星期二, 29 十月 2019 09:49:50 +0800
Subject: [PATCH] 增加基站时间同步,等待systick换成基础定时器

---
 源码/核心板/Src/OnChipDevices/Usart.c |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 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 7ed8dde..e177d8c 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"
@@ -88,7 +88,7 @@
 	GPIO_Init(EU_RX_GPIO, &GPIO_InitStructure);
 	
 	GPIO_InitStructure.GPIO_Pin = EU_TX_PIN;
-	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;							//Tx推挽复用输出
+	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;//GPIO_Mode_AF_PP;							//Tx推挽复用输出
 	GPIO_Init(EU_TX_GPIO, &GPIO_InitStructure);
 	
 #ifdef UART_GPIO_REMAP_ENABLE
@@ -110,7 +110,7 @@
 	
 	USART_ClockInit(EXT_UART, &USART_ClockInitStructure);
 	USART_Init(EXT_UART, &USART_InitStructure);
-	
+//	USART_ITConfig(EXT_UART, USART_IT_RXNE, ENABLE);//??????,????? ??????????
 	// Enable the USARTx 
 	USART_Cmd(EXT_UART, ENABLE); 
 	//DMA配置(须放到UART初始化之后)
@@ -288,7 +288,24 @@
 		m_EUART_TxFrm_Head = EUART_TX_FRM_SIZE-1;
 	m_EUART_TxFrm_FreeFrmLen++;
 }
+void USART_putc(char c)
+{
+	//while(!(USART2->SR & 0x00000040));
+	//USART_SendData(USART2,c);
+	/* e.g. write a character to the USART */
+	USART_SendData(USART1, c);
 
+	/* Loop until the end of transmission */
+	while (USART_GetFlagStatus(USART1, USART_FLAG_TC) == RESET)	;
+}
+void USART_puts(uint8_t *s,uint8_t len)
+{
+	int i;
+	for(i=0; i<len; i++)
+	{
+		USART_putc(s[i]);
+	}
+}
 int fputc(int ch, FILE *f)
 {
 	

--
Gitblit v1.9.3