| | |
| | | void PendSV_Handler(void)
|
| | | {
|
| | | /* USER CODE BEGIN PendSV_IRQn 0 */
|
| | | NVIC_ClearPendingIRQ(PendSV_IRQn); |
| | | SCB->ICSR=SCB_ICSR_PENDSVCLR_Msk; //1<<SCB_ICSR_PENDSVCLR_Pos;
|
| | | // NVIC_ClearPendingIRQ(PendSV_IRQn); |
| | | PendSvCount++;
|
| | | NVIC_DisableIRQ(PendSV_IRQn);
|
| | | // NVIC_DisableIRQ(PendSV_IRQn);
|
| | | PendSvCallBack();
|
| | | /* USER CODE END PendSV_IRQn 0 */
|
| | | /* USER CODE BEGIN PendSV_IRQn 1 */
|
| | |
|
| | |
| | | /* For the available peripheral interrupt handler names, */
|
| | | /* please refer to the startup file (startup_stm32f0xx.s). */
|
| | | /******************************************************************************/
|
| | | /**
|
| | | * @brief This function handles TIM6 global interrupt.
|
| | | */
|
| | | void TIM6_IRQHandler(void)
|
| | | {
|
| | | /* USER CODE BEGIN TIM6_IRQn 0 */
|
| | | if (LL_TIM_IsActiveFlag_UPDATE(TIM6)) { LL_TIM_ClearFlag_UPDATE(TIM6);}
|
| | | |
| | | // KMem.SDD[46]+=1000;
|
| | | // KMem.SDT[93] = LL_TIM_GetCounter(TIM6);
|
| | | /* USER CODE END TIM6_IRQn 0 */
|
| | | /* USER CODE BEGIN TIM6_IRQn 1 */
|
| | |
|
| | | /* USER CODE END TIM6_IRQn 1 */
|
| | | }
|
| | |
|
| | | /**
|
| | | * @brief This function handles DMA1 channel 2 and 3 interrupts.
|
| | |
| | | void DMA1_Channel2_3_IRQHandler(void)
|
| | | {
|
| | | /* USER CODE BEGIN DMA1_Channel2_3_IRQn 0 */
|
| | | Uart1DmaInts++;
|
| | | Uart1Stat.DMACount++;
|
| | | if (LL_DMA_IsActiveFlag_TC2(DMA1))
|
| | | {
|
| | |
|
| | |
| | | else
|
| | | {
|
| | | Uart1Stat.DMASendLen=0;
|
| | | Uart1Stat.Sending=0;
|
| | | Uart1Stat.bSending=0;
|
| | | }
|
| | | }
|
| | | /* USER CODE END DMA1_Channel2_3_IRQn 0 */
|
| | |
| | | void DMA1_Channel4_5_IRQHandler(void)
|
| | | {
|
| | | /* USER CODE BEGIN DMA1_Channel4_5_IRQn 0 */
|
| | | Uart2DmaInts++;
|
| | | Uart2Stat.DMACount++;
|
| | | if (LL_DMA_IsActiveFlag_TC4(DMA1))
|
| | | {
|
| | |
|
| | | LL_DMA_ClearFlag_TC4(DMA1);
|
| | | /* |
| | | Uart2Stat.SendBytes+=Uart2Stat.DMASendLen;
|
| | | DelData(&Uart2Stat.QTx,Uart2Stat.DMASendLen);
|
| | | LL_DMA_ClearFlag_TC4(DMA1);
|
| | |
|
| | |
|
| | | if (!IsEmpty(&Uart2Stat.QTx))
|
| | | {
|
| | |
| | | LL_USART_EnableDMAReq_TX(USART2);
|
| | | }
|
| | | else
|
| | | */ |
| | | {
|
| | | Uart2Stat.DMASendLen=0;
|
| | | Uart2Stat.Sending=0;
|
| | | Uart2Stat.bSending=0;
|
| | | }
|
| | | }
|
| | | /* USER CODE END DMA1_Channel4_5_IRQn 0 */
|
| | |
| | | if (LL_DMA_IsActiveFlag_TC5(DMA1))
|
| | | {
|
| | | LL_DMA_ClearFlag_TC5(DMA1);
|
| | | |
| | |
|
| | | }
|
| | | /* USER CODE END DMA1_Channel4_5_IRQn 1 */
|
| | | }
|
| | |
|
| | | void SPI1_IRQHandler(void)
|
| | | {
|
| | | /* USER CODE BEGIN SPI1_IRQn 0 */
|
| | | SPI1_IRQ_CallBack();
|
| | | /* USER CODE END SPI1_IRQn 0 */
|
| | | /* USER CODE BEGIN SPI1_IRQn 1 */
|
| | |
|
| | | /* USER CODE END SPI1_IRQn 1 */
|
| | | }
|
| | |
|
| | | /**
|
| | | * @brief This function handles USART1 global interrupt.
|
| | | */
|
| | |
| | | Uart1BaudFirstGot=1;
|
| | | Uart1Stat.RXNECount++;
|
| | | unsigned char ch=LL_USART_ReceiveData8(USART1);
|
| | | PushOne(&Uart1Stat.QRx,ch);
|
| | | // PushOne(&Uart1Stat.QRx,ch);
|
| | | Uart1Stat.RecvBytes++;
|
| | | Uart1RecvBuf1[Uart1RecvBuf1DataLen++]=ch;
|
| | | //LL_USART_TransmitData8(USART1,ch);
|
| | |
| | | Uart1Stat.OverRunCount++;
|
| | | }
|
| | | if (LL_USART_IsEnabledIT_IDLE(USART1)&&LL_USART_IsActiveFlag_IDLE(USART1))
|
| | | {//接收完成
|
| | | {//接收完成
|
| | | LL_USART_ClearFlag_IDLE(USART1);
|
| | | Uart1RecvDone();
|
| | | }
|
| | | /* USER CODE END USART1_IRQn 0 */
|
| | | /* USER CODE BEGIN USART1_IRQn 1 */
|
| | | if (LL_USART_IsActiveFlag_TC(USART1))
|
| | | {//发送完成
|
| | | {//发送完成
|
| | | LL_USART_ClearFlag_TC(USART1);
|
| | | Uart1SendDone();
|
| | | }
|
| | |
| | |
|
| | | if (LL_USART_IsActiveFlag_RXNE(USART2))
|
| | | {
|
| | | Uart2BaudGot=1;
|
| | | Uart2BaudFirstGot=1;
|
| | | Uart2Stat.RXNECount++;
|
| | | unsigned char ch=LL_USART_ReceiveData8(USART2);
|
| | | PushOne(&Uart2Stat.QRx,ch);
|
| | | Uart2Stat.RecvBytes++;
|
| | | Uart2RecvBuf1[Uart2RecvBuf1DataLen++]=ch;
|
| | | // unsigned char ch=LL_USART_ReceiveData8(USART2);
|
| | | // Uart2Stat.RXNECount++;
|
| | | // PushOne(&Uart2Stat.QRx,ch);
|
| | | // Uart2Stat.RecvBytes++;
|
| | | // Uart2RecvBuf1[Uart2RecvBuf1DataLen++]=ch;
|
| | |
|
| | | //LL_USART_TransmitData8(USART2,ch);
|
| | | }
|
| | |
| | | Uart2Stat.OverRunCount++;
|
| | | }
|
| | | if (LL_USART_IsEnabledIT_IDLE(USART2)&&LL_USART_IsActiveFlag_IDLE(USART2))
|
| | | {//接收完成
|
| | | {//接收完成
|
| | | LL_USART_ClearFlag_IDLE(USART2);
|
| | | Uart2RecvDone();
|
| | | }
|
| | | /* USER CODE END USART2_IRQn 0 */
|
| | | /* USER CODE BEGIN USART2_IRQn 1 */
|
| | | if (LL_USART_IsActiveFlag_TC(USART2))
|
| | | {//发送完成
|
| | | {//发送完成
|
| | | LL_USART_ClearFlag_TC(USART2);
|
| | | Uart2SendDone();
|
| | | }
|