void DMA1_Channel3_IRQHandler(void)
{
	if(DMA_GetITStatus(DMA1_IT_TC3) != RESET)
	{
		DMA_ClearFlag(DMA1_IT_TC3);
		/* 处理激光模块回传的数据 */
		switch(laser.cmd_id)
		{
			case SINGLE_MEASURE:
				after_single_measure();
				break;
			case CIRCULAR_MEASURE:
				break;
			case SET_RANGE:
				after_set_range();
				break;
			case SET_FREQ:
				after_set_freq();
				break;
			case SET_RESOLUTION:
				after_set_resolution();
				break;
			default:
				break;
		}
		laser_irq_flag = 1;
		
	}
	
}
Exemple #2
0
void DMA2_Stream0_IRQHandler(void){

	if (DMA_GetITStatus(DMA2_Stream0, DMA_IT_TCIF0))
	{
		DMA_ClearITPendingBit(DMA2_Stream0, DMA_IT_TCIF0);
		transfers++;
		if(transfers >= 100){
			GPIO_ToggleBits(GPIOD, GPIO_Pin_12);
			transfers = 0;
		}		
	}
	if (DMA_GetITStatus(DMA2_Stream0, DMA_IT_HTIF0))
	{
		DMA_ClearITPendingBit(DMA2_Stream0, DMA_IT_HTIF0);
	}
}
Exemple #3
0
//USART2接收DMA中断处理函数
void DMA1_Channel6_IRQHandler(void)
{
	OSIntEnter(); 
	
	if(DMA_GetITStatus(DMA1_IT_TC6)!=RESET)						//如果该DMA通道发生中断请求
	{
		OS_ERR err;
		
		DMA_Cmd(DMA1_Channel6,DISABLE);							//关闭DMA1_Channel6
		DMA_ClearITPendingBit(DMA1_IT_TC6);						//清除DMA的中断标志
		
		if(U2R_BufferNum==1)
		{
			DMA1_Channel6->CMAR=(u32)USART2_Rx_Buffer2;		//将缓冲区的地址改为2号
			U2R_BufferNum=2;
			U2R_Buf1_Ok=true;								//将1号缓存区标志位置为1,表示已满可读
			
		}
		else
		{
			DMA1_Channel6->CMAR=(u32)USART2_Rx_Buffer1;		//将缓冲区的地址改为1号
			U2R_BufferNum=1;	
			U2R_Buf2_Ok=true;								//将2号缓存区标志位置为1,表示已满可读
			
		}
		OSTaskSemPost(&ZPH01_Task_TCB,OS_OPT_POST_NONE,&err);//释放任务信号量
		USART_ITConfig(USART2,USART_IT_RXNE,ENABLE);		//使能串口2的接收中断
	
	}
	
	OSIntExit();
}
Exemple #4
0
void
DMA1_Channel2_IRQHandler()
{
    if (DMA_GetITStatus(DMA1_IT_TC2) == SET) {

        if (USART_GetFlagStatus(USART3, USART_FLAG_TXE) == SET) {
            if (usart_tx_dmafifo_out_idx == usart_tx_dmafifo_in_idx) {
                dma_running = 0;    // no more to send, shut down
                DMA_ITConfig(USART3_TX_DMA_CHANNEL, DMA_IT_TC, DISABLE);
                DMA_Cmd(USART3_TX_DMA_CHANNEL, DISABLE);
            } else {
                if (USART_GetFlagStatus(USART3, USART_FLAG_TXE) == RESET) {
                    debug_printf("DMACH2\r\n");
                    for (;;)
                        asm("nop"); // why am i here?
                }
                kick_dma_usart_tx(4);
            }
        } else {
            USART_ITConfig(USART3, USART_IT_TXE, ENABLE);
            dma_running = 3;    // indicate DMA TC occurred (but not yet USART TC)
        }

        DMA_ClearITPendingBit(DMA1_IT_GL2);
        //redundant DMA_ClearFlag(DMA1_FLAG_TC2);
        DMA_ClearFlag(USART3_TX_DMA_FLAG_GL);   // in example


    } // ...if (DMA_GetITStatus(DMA1_IT_TC2) == SET)
    else {
        asm("nop"); // why am i here?
    }
}
Exemple #5
0
/**
  * @brief  This function handles DMA2 Stream1 Interrupt
  * @param  None
  * @retval None
  */
void Ethernet_IRQHandler(void)
{
  /* This DMA is used for transferring the DCMI Data */
  if(DMA_GetITStatus(DMA2_Stream1, DMA_IT_TCIF1) != RESET)
  {
    /* Mark buffer as filled */
    IPCAM_ImageBuffer.BufferStatus = BUFFER_FILLED;

    /* Clear interrupt pending bit */
    DMA_ClearITPendingBit(DMA2_Stream1, DMA_IT_TCIF1);
  }
  /* Half Transfer complete interrupt */
  else if (DMA_GetFlagStatus(DMA2_Stream1, DMA_FLAG_HTIF1) != RESET)
  {
    /* Clear the Interrupt flag */
    DMA_ClearFlag(DMA2_Stream1, DMA_FLAG_HTIF1);
  }
  /* FIFO Error interrupt */
  else if (DMA_GetFlagStatus(DMA2_Stream1, DMA_FLAG_FEIF1) != RESET)
  {
    /* Clear the Interrupt flag */
    DMA_ClearFlag(DMA2_Stream1, DMA_FLAG_FEIF1);
  }
  /* Tranfer error interrupt */
  else if (DMA_GetFlagStatus(DMA2_Stream1, DMA_FLAG_TEIF1) != RESET)
  {
    DCMI_ClearFlag(DCMI_FLAG_OVFRI);

    /* Clear interrupt pending bit */
    DMA_ClearITPendingBit(DMA2_Stream1, DMA_IT_TEIF1);

    /* Mark buffer as empty */
    IPCAM_ImageBuffer.BufferStatus = BUFFER_EMPTY;
  }
}
Exemple #6
0
void CmdUnit_t::IRQDmaTxHandler() {
    if(DMA_GetITStatus(DMA1_IT_TC2)) {
        DMA_ClearITPendingBit(DMA1_IT_GL2); // Clear CH2 IRQ global bit
        // Switch to next buffer if needed
        if(TxIndx != 0) IStartTx();
        else IDmaIsIdle = true;
    }
}
void DMA1_Channel1_IRQHandler(void)	   
{  
  if(DMA_GetITStatus(DMA1_IT_TC1))
  {
    DMA_ClearITPendingBit(DMA1_IT_GL1);
    isr_evt_set(EVT_ADC_DONE, tid_conflict_monitor);
  }
}
Exemple #8
0
 void DMA1_Channel6_IRQHandler(void)
 {
     if(DMA_GetITStatus(DMA1_IT_TC6))
     {
         freeCir[2]+=DMA_BUFSIZE;
         DMA_ClearITPendingBit(DMA1_IT_TC6);
     }
 }
Exemple #9
0
static void madArchMem_IRQ_Handler(void)
{
    if(SET == DMA_GetITStatus(ARCHM_DMA_TX_ITTC)) {
        DMA_Cmd(ARCHM_DMA_TX, DISABLE);
        madSemRelease(&mad_archm_waiter);
        DMA_ClearITPendingBit(ARCHM_DMA_TX_ITTC);
    }
}
Exemple #10
0
void DMA1_Channel1_IRQHandler(void)
{
	if(DMA_GetITStatus(DMA1_IT_TC1))
	{
		defaultADCManager->isTransferDone=1;
		DMA_ClearITPendingBit(DMA1_IT_TC1);
	}
}
Exemple #11
0
void DMA1_Channel2_IRQHandler(void)     //spi 发送dma 中断 
{
	if(DMA_GetITStatus(DMA1_IT_TC2)==SET)
	{
	  DMA_ClearITPendingBit(DMA1_IT_TC2);
	}

}
Exemple #12
0
/********************************************************************************************************
**函数信息 :DMA1_Channel1_IRQHandler()     
**功能描述 : DMA1通道1的中断函数
**输入参数 :无
**输出参数 :无
********************************************************************************************************/
void DMA1_Channel1_IRQHandler()
{
	if(DMA_GetITStatus(DMA1_IT_TC1))
		{
			DMA_ClearITPendingBit(DMA1_IT_TC1);
			dma1Flag = 0x1;
		}
}
Exemple #13
0
void DMA1_Channel4_IRQHandler(void)
{
    if(DMA_GetITStatus(DMA1_IT_TC4) == SET){
        DMA_ClearITPendingBit(DMA1_IT_TC4);
        DMA_Cmd(DMA1_Channel4, DISABLE);
        USART_DMACmd(USART1, USART_DMAReq_Tx, DISABLE);
        usart1_process.txBusy = 0;
        // Tx data success
    }
    if(DMA_GetITStatus(DMA1_IT_TE4) == SET){
        DMA_ClearITPendingBit(DMA1_IT_TE4);
        DMA_Cmd(DMA1_Channel4, DISABLE);
        USART_DMACmd(USART1, USART_DMAReq_Tx, DISABLE);
        usart1_process.txBusy = 0;
        // Tx data fail
    }
}
Exemple #14
0
//DMA1_Stream4中断服务函数
void DMA1_Stream4_IRQHandler(void)
{      
	if(DMA_GetITStatus(DMA1_Stream4,DMA_IT_TCIF4)==SET)////DMA1_Stream4,传输完成标志
	{ 
		DMA_ClearITPendingBit(DMA1_Stream4,DMA_IT_TCIF4);
      	i2s_tx_callback();	//执行回调函数,读取数据等操作在这里面处理  
	}   											 
}  
Exemple #15
0
/*USART RX - Stream*/
void DMA2_Stream6_IRQHandler(void){

	if (DMA_GetITStatus(DMA2_Stream6, DMA_IT_TCIF6) == SET)
	{		
		DMA_ClearITPendingBit(DMA2_Stream6, DMA_IT_TCIF6);
		//DMA_Cmd(DMA2_Stream6,DISABLE);
	}
}
/**
 * @brief Interrupt handler of DCMI DMA stream
 */
void DMA1_Channel1_IRQHandler( void )
{
	if ( DMA_GetITStatus( DMA1_IT_TC1 ) != RESET ) // Full buffer
	{
		DMA_ClearITPendingBit( DMA1_IT_TC1 );
		sProcUpdateSignalMaximum(adcBuffer);
	}
}
Exemple #17
0
/*ADC Stream*/
void DMA2_Stream0_IRQHandler( ){

	if (DMA_GetITStatus(DMA2_Stream0, DMA_IT_TCIF0)){
		DMA_ClearITPendingBit(DMA2_Stream0, DMA_IT_TCIF0);

		adcDMA = true;
	}
}
/**
  * @brief  This function handles DMA2 interrupt request
  * @param  None
  * @retval None
  */
void DMA_RX_IRQHandler(void)
{ 
  if (DMA_GetITStatus(DMA_RX_IT_TC)== SET)
  {
    RxStatus = 1;
    DMA_ClearITPendingBit(DMA_RX_IT_TC);
  }
}
Exemple #19
0
void DMA1_Channel7_IRQHandler(void)
{
	if(DMA_GetITStatus(DMA1_IT_TC7) != RESET)
	{
		DMA_Cmd(DMA1_Channel7, DISABLE);
		DMA_ClearITPendingBit(DMA1_IT_GL7);
		USART_ITConfig(USART2, USART_IT_TC, ENABLE);
	}
}
/*COM1 RX area*/
void COM1_DMA_RX_IRQHandler(void)
{
	if (DMA_GetITStatus(COM_RX_DMA_STREAM[USART_COM1], COM_RX_DMA_IT_TCIF[USART_COM1]))
	{
		COM1_RX_COMPLETE();

		DMA_ITConfig(COM_RX_DMA_STREAM[USART_COM1], DMA_IT_TC, DISABLE);
	}
}
Exemple #21
0
void DMA2_Channel5_IRQHandler(void)
{
	if(DMA_GetITStatus(DMA2_IT_TC5) != RESET)
	{
		DMA_Cmd(DMA2_Channel5, DISABLE);
		DMA_ClearITPendingBit(DMA2_IT_GL5);
		USART_ITConfig(UART4, USART_IT_TC, ENABLE);
	}
}
Exemple #22
0
void adcInterruptHandler(void)
{
  portBASE_TYPE xHigherPriorityTaskWoken;
  AdcGroup* adcBuffer;

  if(DMA_GetITStatus(DMA1_IT_HT1))
  {
    DMA_ClearITPendingBit(DMA1_IT_HT1);
    adcBuffer = (AdcGroup*)&adcValues[0];
    xQueueSendFromISR(adcQueue, &adcBuffer, &xHigherPriorityTaskWoken);
  }
  if(DMA_GetITStatus(DMA1_IT_TC1))
  {
    DMA_ClearITPendingBit(DMA1_IT_TC1);
    adcBuffer = (AdcGroup*)&adcValues[ADC_MEAN_SIZE];
    xQueueSendFromISR(adcQueue, &adcBuffer, &xHigherPriorityTaskWoken);
  }
}
Exemple #23
0
void DMA2_Stream5_IRQHandler(void)
{
	if (DMA_GetITStatus(DMA2_Stream5, DMA_IT_TCIF5))
	{
		DMA_ClearITPendingBit(DMA2_Stream5, DMA_IT_TCIF5);
		sbus_rx_complete();
	}

}
Exemple #24
0
extern "C" void DMA1_Stream3_IRQHandler() //RX
{
	if( DMA_GetITStatus(DMA1_Stream3, DMA_IT_TCIF3) == SET )
	{
		DMA_ClearITPendingBit(DMA1_Stream3, DMA_IT_TCIF3);
		csOff();
		spi2Work = 0;
	}
}
void DMA1_Stream5_IRQHandler (void)
{
    if (DMA_GetITStatus(DMA1_Stream5, DMA_IT_TCIF5)
            && DMA_GetFlagStatus(DMA1_Stream5, DMA_FLAG_TCIF5)) {
        DMA_ClearITPendingBit(DMA1_Stream5, DMA_IT_TCIF5);
        DMA_ClearFlag(DMA1_Stream5, DMA_FLAG_TCIF5);
    }
    NVIC_ClearPendingIRQ(DMA1_Stream5_IRQn);
}
void DMA2_Stream0_IRQHandler(void) {
    if (DMA_GetITStatus(DMA2_Stream0, DMA_IT_TCIF0) != RESET) {
        if (fdi_adc_callback) {
            volatile uint16_t *buffer = (DMA_GetCurrentMemoryTarget(DMA2_Stream0) == 0) ? fdi_adc_dma_buffer_1 : fdi_adc_dma_buffer_0;
            (*fdi_adc_callback)(buffer, fdi_adc_dma_buffer_length);
        }
        DMA_ClearITPendingBit(DMA2_Stream0, DMA_IT_TCIF0);
    }
}
Exemple #27
0
static void HAL_SPI_TX_DMA_Stream_InterruptHandler(HAL_SPI_Interface spi)
{
    if (DMA_GetITStatus(spiMap[spi].SPI_TX_DMA_Stream, spiMap[spi].SPI_TX_DMA_Stream_TC_Event) == SET)
    {
        DMA_ClearITPendingBit(spiMap[spi].SPI_TX_DMA_Stream, spiMap[spi].SPI_TX_DMA_Stream_TC_Event);
        SPI_I2S_DMACmd(spiMap[spi].SPI_Peripheral, SPI_I2S_DMAReq_Tx, DISABLE);
        DMA_Cmd(spiMap[spi].SPI_TX_DMA_Stream, DISABLE);
    }
}
void DMA1_Channel4_IRQHandler(void)
{
	if(DMA_GetITStatus(DMA1_IT_TC4) != RESET)
	{
		DMA_ClearFlag(DMA1_IT_TC4);

	}
	
}
Exemple #29
0
/*
 * DMA1- Interrupt
 */
extern "C" { void DMA1_Stream6_IRQHandler(void)
{
  /* Test on DMA Stream Transfer Complete interrupt */
  if (DMA_GetITStatus(DMA1_Stream6, DMA_IT_TCIF6))
  {
    /* Clear DMA Stream Transfer Complete interrupt pending bit */
    DMA_ClearITPendingBit(DMA1_Stream6, DMA_IT_TCIF6);
  }
}}
Exemple #30
0
/**
  * @brief  This function handles DMA2_Channel3 global interrupt request.
	* @brief	TIM定时SDADC采集,DMA传输中断-得到传输完成标志
  * @param  None
  * @retval None
  */
void DMA2_Channel3_IRQHandler(void)
{
	if(DMA_GetITStatus(DMA2_IT_TC3))
	{
		collect_finished = 1;
		TIM_Cmd(TIM19, DISABLE);//采集到一列数据,关闭定时器,无采样频率触发,待处理完数据后再打开此定时器
		DMA_ClearITPendingBit(DMA2_IT_GL3);
//		DMA_Cmd(DMA2_Channel3, DISABLE);  //关闭DMA2 所指示的通道
	}
}