| | |
| | | #endif |
| | | extern __IO uint32_t uwTick; |
| | | |
| | | unsigned char Uart5RxBuf[RX5BUFSIZE]; |
| | | unsigned char Uart5TxBuf[TX5BUFSIZE]; |
| | | unsigned char Uart3RxBuf[UART3RXBUFSIZE]; |
| | | unsigned char Uart3TxBuf[UART3TXBUFSIZE]; |
| | | stUartStat Uart3Stat={0}; |
| | | unsigned int Uart3RecvBuf1DataLen =0; |
| | | unsigned int Uart3ToSendLen =0 ; |
| | | unsigned int Uart3SentLen = 0; |
| | | |
| | | unsigned char Uart5RxBuf[UART5RXBUFSIZE]; |
| | | unsigned char Uart5TxBuf[UART5TXBUFSIZE]; |
| | | stUartStat Uart5Stat={0}; |
| | | unsigned int Uart5RecvBuf1DataLen =0; |
| | | unsigned int Uart5ToSendLen =0 ; |
| | | unsigned int Uart5SentLen = 0; |
| | | |
| | | unsigned char Uart6RxBuf[RX6BUFSIZE]; |
| | | unsigned char Uart6TxBuf[TX6BUFSIZE]; |
| | | unsigned char Uart6RxBuf[UART6RXBUFSIZE]; |
| | | unsigned char Uart6TxBuf[UART6TXBUFSIZE]; |
| | | stUartStat Uart6Stat={0}; |
| | | unsigned int Uart6RecvBuf1DataLen =0; |
| | | unsigned int Uart6ToSendLen =0 ; |
| | |
| | | SCB->ICSR=SCB_ICSR_PENDSVSET_Msk; //1<<SCB_ICSR_PENDSVSET_Pos; |
| | | } |
| | | |
| | | void PendSvCallBack() |
| | | { |
| | | #if (BOARD_TYPE == 14) |
| | | ///* |
| | | if (bSPI1RecvDone) |
| | | { |
| | | bSPI1RecvDone=0; |
| | | ParseFP0Pkg(SPI1RecvBuf,nSPI1RecvLenInBuf); |
| | | } |
| | | //*/ |
| | | #endif |
| | | if (Uart2Stat.bPacketRecved) |
| | | { |
| | | KBusParsePacket(2, (pKBPacket)Uart2RecvBuf1, Uart2RecvBuf1DataLen); |
| | | Uart2RecvBuf1DataLen=0; |
| | | Uart2Stat.bPacketRecved=0; |
| | | Uart2RecvDMA(Uart2RecvBuf1,sizeof(Uart2RecvBuf1)); |
| | | } |
| | | } |
| | | |
| | | void SPI1_IRQ_CallBack() |
| | | { |
| | |
| | | bSPI1RecvDone=1; |
| | | nSPI1RecvPos=0; |
| | | bSPI1Recving=0; |
| | | |
| | | |
| | | TriggerPendSV(); |
| | | } |
| | |
| | | // ParsePacket((pKBPacket)Uart2RecvBuf1,Uart2RecvBuf1DataLen); |
| | | } |
| | | |
| | | void Uart3SendDone() |
| | | { |
| | | // Uart1Stat.TcCount++; |
| | | return; |
| | | } |
| | | |
| | | void Uart3RecvDone() |
| | | { |
| | | // Uart3Stat.IdelCount++; |
| | | // NVIC_SetPendingIRQ(PendSV_IRQn); |
| | | // SCB->ICSR=SCB_ICSR_PENDSVSET_Msk; //1<<SCB_ICSR_PENDSVSET_Pos; |
| | | |
| | | if (Uart3RecvBuf1DataLen >0) |
| | | { |
| | | Uart3Stat.bPacketRecved=1; |
| | | // SCB->ICSR=SCB_ICSR_PENDSVSET_Msk; //1<<SCB_ICSR_PENDSVSET_Pos; |
| | | // KLParsePacket(Uart1RecvBuf1,Uart1RecvBuf1DataLen); |
| | | // Uart1RecvBuf1DataLen=0; |
| | | } |
| | | } |
| | | void Uart3SendPacket(char * str, int len) |
| | | { |
| | | memcpy(Uart3TxBuf,str,len); |
| | | Uart3ToSendLen = len; |
| | | LL_USART_EnableIT_TXE(USART3); |
| | | } |
| | | |
| | | void Uart5SendDone() |
| | | { |
| | | // Uart1Stat.TcCount++; |
| | |
| | | // Uart1RecvBuf1DataLen=0; |
| | | } |
| | | } |
| | | void Uart6SendPacket(char * str, int len) |
| | | void Uart6SendPacket(unsigned char * str, int len) |
| | | { |
| | | memcpy(Uart6TxBuf,str,len); |
| | | Uart6ToSendLen = len; |
| | |
| | | LL_USART_EnableIT_TXE(USART6); |
| | | } |
| | | |
| | | void SLPSendPacket(char * str, uchar len) |
| | | void SLPSendPacket(void * str, uchar len) |
| | | { |
| | | Uart6SendPacket(str,len); |
| | | } |