From fd498f8f31ff9428fa4c042337ac2fba895d4794 Mon Sep 17 00:00:00 2001 From: yincheng.zhong <zhyinch@gmail.com> Date: 星期五, 01 十一月 2019 13:29:49 +0800 Subject: [PATCH] 实现10us精度基站与标签时间同步 --- 源码/核心板/Src/OnChipDevices/Usart.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 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 e177d8c..0718116 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,8 +88,12 @@ GPIO_Init(EU_RX_GPIO, &GPIO_InitStructure); GPIO_InitStructure.GPIO_Pin = EU_TX_PIN; - GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;//GPIO_Mode_AF_PP; //Tx推挽复用输出 + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; //Tx推挽复用输出 GPIO_Mode_AF_PP GPIO_Init(EU_TX_GPIO, &GPIO_InitStructure); + + GPIO_InitStructure.GPIO_Pin = EU_485_PIN; + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; //Tx推挽复用输出 GPIO_Mode_AF_PP + GPIO_Init(EU_485_GPIO, &GPIO_InitStructure); #ifdef UART_GPIO_REMAP_ENABLE GPIO_PinRemapConfig(UART_GPIO_REMAP, ENABLE); @@ -175,6 +179,7 @@ { if(m_bEUARTTxEn) { + OUT485_DISABLE; m_bEUARTTxEn = 0; // temp32 = GPIOC->CRH; //C10悬空输入 // temp32 &= ~(0x00000000F<<8); @@ -185,6 +190,7 @@ m_bEUARTCheckingSend = 0; return; } + OUT485_ENABLE; if(!m_bEUARTTxEn) { m_bEUARTTxEn = 1; @@ -193,6 +199,7 @@ // temp32 |= (0x000000009<<8); // GPIOC->CRH = temp32;// */ } + //发送一个字节数据 EXT_UART->DR = m_EUART_TxFrames[m_EUART_TxFrm_Tail].buf[s_count]; s_count++; -- Gitblit v1.9.3