| | |
| | | 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 |
| | |
| | | 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) |
| | | { |
| | | |