diff --git a/source/src/bsp.c b/source/src/bsp.c index f41ade4..2175306 100644 --- a/source/src/bsp.c +++ b/source/src/bsp.c @@ -703,21 +703,21 @@ void PrintfMess(void) } void DBGUartSendByte(uint8_t sData) { -#if USE_BOOTLOADER - LPUart_SendData(M0P_LPUART0, sData); -#else - Uart_SendDataPoll(M0P_UART0, sData); -#endif + if(gDebugChannel == DBG_CH_RS485_1) { + LPUart_SendData(M0P_LPUART0, sData); + } else { + Uart_SendDataPoll(M0P_UART0, sData); + } } void DBGUartSend(uint8_t *sData, int sLen) { -#if USE_BOOTLOADER - LPUart0SendArray(sData, sLen); -#else - for(int i = 0; i < sLen; i++) { - Uart_SendDataPoll(M0P_UART0, sData[i]); + if(gDebugChannel == DBG_CH_RS485_1) { + LPUart0SendArray(sData, sLen); + } else { + for(int i = 0; i < sLen; i++) { + Uart_SendDataPoll(M0P_UART0, sData[i]); + } } -#endif } void LPUart0SendArray(uint8_t *sData, uint8_t sLen) { @@ -805,7 +805,7 @@ void Uart0_IRQHandler(void) if(Uart_GetStatus(M0P_UART0, UartRC)) { ///接收数据 Uart_ClrStatus(M0P_UART0, UartRC); ///<清接收中断请求 uint8_t u8RxData = Uart_ReceiveData(M0P_UART0); ///读取数据 - //DebugUartIRQ(u8RxData); + DebugUartIRQ(u8RxData); } }