Example #1
0
void UART4_IRQHandler(void)
{
	extern void uart4_interrupt_handler(void);
	rt_interrupt_enter();
	uart4_interrupt_handler();
	rt_interrupt_leave();
}
Example #2
0
/* Implementation of UART0 handler named in startup code. */
void UART0_RX_TX_IRQHandler(void)
{
    rt_interrupt_enter();
    rt_hw_serial_isr((struct rt_serial_device*)&_kinetis_serial, RT_SERIAL_EVENT_RX_IND);
    //UART_DRV_IRQHandler(0);
    rt_interrupt_leave();
}
Example #3
0
void EXTI1_IRQHandler(void)
{
	extern void adxl_isr_handle(void);
	rt_interrupt_enter();
	adxl_isr_handle();
	rt_interrupt_leave();
}
Example #4
0
void URT01_IRQHandler(void)
{
	struct uart_device *uartDev = RT_NULL;
	
	uartDev = &uartDev01;

	rt_interrupt_enter(); /* enter interrupt */

//	if (uart->uart_device->Interrupt & ((1 << bsUART_TIMEOUT_INTENAB) | (1 << bsUART_RECEIVE_INTENAB))) // RX
//	{
//		rt_hw_serial_isr(&serial01, RT_SERIAL_EVENT_RX_IND);
//	}
//
//	if (uart->uart_device->Interrupt & (1 << bsUART_TRANSMIT_INTENAB)) // TX
//	{
//		;
//	}
//
//	/* clear all interrupt */
//	uart->uart_device->IntClear = (1 << bsUART_RECEIVE_INTENAB)
//									| (1 << bsUART_TRANSMIT_INTENAB)
//									| (1 << bsUART_TIMEOUT_INTENAB);

	rt_interrupt_leave(); /* leave interrupt */
}
Example #5
0
void EXTI2_IRQHandler(void)
{
	extern void hmc_isr_handle(void);
	rt_interrupt_enter();
	hmc_isr_handle();
	rt_interrupt_leave();
}
Example #6
0
void rt_fh_uart_handler(int vector, void *param)
{
    int status;
    unsigned int ret;
    struct fh_uart *uart;
    unsigned int reg_status;
    rt_device_t dev = (rt_device_t)param;
    uart = (struct fh_uart *)dev->user_data;
    status = uart_get_iir_status(uart->uart_port);
    if (status & UART_IIR_NOINT)
    {
        return;
    }
    if(status & UART_IIR_THREMPTY) {
        //first close tx isr
        uart_disable_irq(uart->uart_port,UART_IER_ETBEI);

        rt_hw_serial_isr((struct rt_serial_device *)dev, RT_SERIAL_EVENT_TX_DONE);
    }
    else if((status & UART_IIR_CHRTOUT)==UART_IIR_CHRTOUT) {
        //bug....
        //if no data in rx fifo
        reg_status = uart_get_status(uart->uart_port);
        if((reg_status & 1<<3) == 0)
            ret = uart_getc(uart->uart_port);
    }
    else {
        rt_interrupt_enter();
        rt_hw_serial_isr((struct rt_serial_device *)dev, RT_SERIAL_EVENT_RX_IND);
        rt_interrupt_leave();
    }
}
Example #7
0
void ETH_IRQHandler(void)
{
    /* enter interrupt */
    rt_interrupt_enter();

    if (ETH_GetITStatus(ETH_INT_TX_COMPLETE_FRAME))
    {
        rt_sem_release(&cme_eth_device.tx_buf_free);
        ETH_ClearITPendingBit(ETH_INT_TX_COMPLETE_FRAME);
    }

    if (ETH_GetITStatus(ETH_INT_RX_STOP))
    {
        CME_ETH_PRINTF("ETH_INT_RX_STOP\n");
        ETH_ClearITPendingBit(ETH_INT_RX_STOP);
    }

    if ((ETH_GetITStatus(ETH_INT_RX_BUF_UNAVAI)) ||
            (ETH_GetITStatus(ETH_INT_RX_COMPLETE_FRAME)))
    {
        /* a frame has been received */
        eth_device_ready(&(cme_eth_device.parent));

        ETH_ITConfig(ETH_INT_RX_COMPLETE_FRAME, FALSE);
        ETH_ITConfig(ETH_INT_RX_BUF_UNAVAI, FALSE);
        ETH_ClearITPendingBit(ETH_INT_RX_BUF_UNAVAI);
        ETH_ClearITPendingBit(ETH_INT_RX_COMPLETE_FRAME);
    }

    /* leave interrupt */
    rt_interrupt_leave();
}
Example #8
0
void TIM7_IRQHandler(void)
{
	extern void tim7_isr_handle(void);
	rt_interrupt_enter();
	tim7_isr_handle();
	rt_interrupt_leave();	
}
void TIMER3_IRQHandler(void)
{
	 rt_interrupt_enter();
   ts_tick ++;
   LPC_TIM3->IR |= TIM_IR_MR0;         /* clear interrupt */
	 rt_interrupt_leave();
}
Example #10
0
/**
 * This is the timer interrupt service routine.
 *
 */
void rt_hw_timer_handler(void)
{
	/* enter interrupt */
	rt_interrupt_enter();

#if 0 //USE_STM32_IWDG
	/* Reloads IWDG counter with value defined in the reload register */
	/* #define KR_KEY_Reload    ((uint16_t)0xAAAA) */
	IWDG->KR = 0xAAAA;
#endif

#if USE_STM32_WWDG
	extern volatile int is_need_fed_wwdg;
	if (0 != is_need_fed_wwdg)
		WWDG->CR = WWDG_RELOAD_VALUE;
#endif

	rt_tick_increase();

#ifdef RT_USING_LWIP
	extern void snmp_inc_sysuptime(void);
	snmp_inc_sysuptime();
#endif
	/* leave interrupt */
	rt_interrupt_leave();
}
Example #11
0
void DMA1_Channel7_IRQHandler(void)
{
	if (DMA_GetITStatus(DMAx_RX_FLAG_TCIF) != RESET) {
		rt_interrupt_enter();
		
		DMA_Cmd(DMAx_RX_CHANNEL, DISABLE);
		DMA_ClearITPendingBit(DMAx_RX_FLAG_TCIF);
		
		I2C_GenerateSTOP(I2Cx, ENABLE);
		
		rt_sem_release(&DMA_RX_Sem);
		
		rt_interrupt_leave();
	}
	else
	{
		DMA_ClearITPendingBit(DMAx_RX_FLAG_TEIF);
		rt_kprintf("DMA RX ERROR!\nSR1=0x%04x\nSR1=0x%04x\nDR=0x%04x\nCCR=0x%04x\nCR1=0x%04x\nCR2=0x%04x\n",
					I2Cx->SR1,
					I2Cx->SR2,
					I2Cx->DR,
					I2Cx->CCR,
					I2Cx->CR1,
					I2Cx->CR2);
	}
}
void USART3_IRQHandler(void)
{
    struct stm32_uart* uart;

    uart = &uart3;

    /* enter interrupt */
    rt_interrupt_enter();
    if(USART_GetITStatus(uart->uart_device, USART_IT_RXNE) != RESET)
    {
        rt_hw_serial_isr(&serial3, RT_SERIAL_EVENT_RX_IND);
        /* clear interrupt */
        USART_ClearITPendingBit(uart->uart_device, USART_IT_RXNE);
    }
    if (USART_GetITStatus(uart->uart_device, uart->tx_irq_type) != RESET)
    {
        /* clear interrupt */
        if (uart->tx_irq_type == USART_IT_TC)
        {
            USART_ClearITPendingBit(uart->uart_device, uart->tx_irq_type);
        }
    }
    if (USART_GetFlagStatus(uart->uart_device, USART_FLAG_ORE) == SET)
    {
        stm32_getc(&serial3);
    }

    /* leave interrupt */
    rt_interrupt_leave();
}
Example #13
0
/**
 * Uart common interrupt process. This need add to uart ISR.
 *
 * @param serial serial device
 */
static void uart_isr(struct rt_serial_device *serial)
{
    struct imxrt_uart *uart;
    LPUART_Type *base;

    RT_ASSERT(serial != RT_NULL);

    uart = (struct imxrt_uart *) serial->parent.user_data;
    RT_ASSERT(uart != RT_NULL);

    base = uart->uart_base;
    RT_ASSERT(base != RT_NULL);

    /* enter interrupt */
    rt_interrupt_enter();

    /* UART in mode Receiver -------------------------------------------------*/
    if (LPUART_GetStatusFlags(base) & kLPUART_RxDataRegFullFlag)
    {
        rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_IND);
    }

    /* If RX overrun. */
    if (LPUART_STAT_OR_MASK & base->STAT)
    {
        /* Clear overrun flag, otherwise the RX does not work. */
        base->STAT = ((base->STAT & 0x3FE00000U) | LPUART_STAT_OR_MASK);
    }

    /* leave interrupt */
    rt_interrupt_leave();
}
Example #14
0
void USART3_IRQHandler(void)
{

    //用户程序..
    UartType *P2data = &UartAppData3;

    /* enter interrupt */
    rt_interrupt_enter();
    if ( USART_GetITStatus(USART3, USART_IT_RXNE) != RESET )
    {
        UCHAR ucChar;    
        USART_ClearITPendingBit(USART3, USART_IT_RXNE);
        ucChar = USART_ReceiveData(USART3);

        if ( !P2data->Flags.Solo.RecFlame )
        {
            P2data->RxTimeout = __25ms__;
            if ( P2data->RecCnt < (UART_BUFF_SIZE-1) )
            {
                P2data->TxRxBuf[P2data->RecCnt] = ucChar;
                P2data->RecCnt++;
                if ( P2data->RecCnt == 8 )
                {
                    P2data->Flags.Solo.ShortFrame =1;
                }
                if ( P2data->RecCnt == UART_BUFF_SIZE-1 )
                {
                    P2data->Flags.Solo.RecFlame =1;
                }
                //if (P2data->RecCnt == UART_SHORT_LEN)
                //{
                //    P2data->Flags->Solo->ShortFrame =1;
                //}
            }
        }

    }
    else if ( USART_GetITStatus(USART3,USART_IT_TXE) )
    {
        USART_ClearITPendingBit(USART3,USART_IT_TXE);
        USART_ClearFlag(USART3,USART_FLAG_TC);
        if ( P2data->SentCnt <  P2data->ToSend )
        {
            USART_SendData(USART3,P2data->TxRxBuf[P2data->SentCnt++]);        
        }
        else
        {
            USART_ITConfig(USART3, USART_IT_TXE, DISABLE);
            USART_ITConfig(USART3, USART_IT_TC,  ENABLE);
        }
    }
    else if ( USART_GetITStatus(USART3,USART_IT_TC) )
    {
        P2data->Flags.Solo.TxStart = 0;
        Run_void(P2data->DisTxPin);
        USART_ITConfig(USART3, USART_IT_TC,  DISABLE);
    }
    /* leave interrupt */
    rt_interrupt_leave();
}
Example #15
0
void EXTI0_IRQHandler(void)
{
	extern void gyro_isr_handle(void);
	rt_interrupt_enter();
	gyro_isr_handle();
	rt_interrupt_leave();
}
Example #16
0
void UART1_IRQHandler(void)
{
    uint32_t intsrc;
    uint32_t iir;
    uint32_t lsr;

    rt_interrupt_enter();

    /* Determine the interrupt source */
    intsrc = (LPC_UART1->IIR) & UART_IIR_BITMASK;
    iir = intsrc & UART_IIR_INTID_MASK;

    // Receive Line Status
    if ( iir == UART_IIR_INTID_RLS )
    {
        // Check line status
        lsr = (LPC_UART1->LSR) & UART_LSR_BITMASK;
        // Mask out the Receive Ready and Transmit Holding empty status
        lsr &= (UART_LSR_OE|UART_LSR_PE|UART_LSR_FE|UART_LSR_BI|UART_LSR_RXFE);
        // If any error exist
        if (lsr)
        {
//        	UART_IntErr(lsr);
        }
    }


    // Receive Data Available
    if ( iir == UART_IIR_INTID_RDA )
    {
    	RecvFifoLength = FIFO_THRESHOLD;
    	rt_hw_serial_char_isr(&serial_device);
    }

    // Receive Character time-out
    if( iir == UART_IIR_INTID_CTI )
    {
    	RecvFifoLength = FIFO_THRESHOLD;
    	rt_hw_serial_timeout_isr(&serial_device);
    }

    // Transmit Holding Empty
    if ( iir == UART_IIR_INTID_THRE )
    {
    	SendFifoLength = 0;

#if (RT_DEVICE_FLAG_TX == RT_DEVICE_FLAG_DMA_TX)
    	if( writeSendFifo() == 0 )
    	{
    		rt_hw_serial_dma_tx_isr(&serial_device);
    	}
#else
    	rt_hw_serial_int_tx_isr(&serial_device);
#endif
    }

    rt_interrupt_leave();

}
Example #17
0
void UART3_IRQHandler(void)
{
	rt_interrupt_enter();
	
	uart3_isr();
	
	rt_interrupt_leave();
}
Example #18
0
void MFS3RX_IRQHandler(void)
{
	/* enter interrupt */
	rt_interrupt_enter();
	rt_hw_serial_isr(&serial3, RT_SERIAL_EVENT_RX_IND);
	/* leave interrupt */
	rt_interrupt_leave();
}
Example #19
0
void EXTI15_10_IRQHandler(void)
{
	void ppm_interrupt_handle(void);
	rt_interrupt_enter();
	ppm_interrupt_handle();
	rt_interrupt_leave();	

}
Example #20
0
 /*******************************************************************************
  * Function Name  : WWDG_IRQHandler
  * Description    : This function handles WWDG interrupt request.
  * Input          : None
  * Output         : None
  * Return         : None
  *******************************************************************************/
void WWDG_IRQHandler(void)
{
 	/* enter interrupt */
 	rt_interrupt_enter();

 	/* leave interrupt */
 	rt_interrupt_leave();
 }
Example #21
0
void USB_LP_CAN1_RX0_IRQHandler(void)
#endif
{
  /* enter interrupt */
  rt_interrupt_enter();
  USB_Istr();
  rt_interrupt_leave();
}
Example #22
0
void EXTI0_3_Handler(void)
{
    rt_interrupt_enter();
    GPIO_EXTI_Callback(GPIO_PIN_0);
    GPIO_EXTI_Callback(GPIO_PIN_1);
    GPIO_EXTI_Callback(GPIO_PIN_2);
    GPIO_EXTI_Callback(GPIO_PIN_3);
    rt_interrupt_leave();
}
Example #23
0
void EXTI4_7_Handler(void)
{
    rt_interrupt_enter();
    GPIO_EXTI_Callback(GPIO_PIN_4);
    GPIO_EXTI_Callback(GPIO_PIN_5);
    GPIO_EXTI_Callback(GPIO_PIN_6);
    GPIO_EXTI_Callback(GPIO_PIN_7);
    rt_interrupt_leave();
}
Example #24
0
void EXTI8_11_Handler(void)
{
    rt_interrupt_enter();
    GPIO_EXTI_Callback(GPIO_PIN_8);
    GPIO_EXTI_Callback(GPIO_PIN_9);
    GPIO_EXTI_Callback(GPIO_PIN_10);
    GPIO_EXTI_Callback(GPIO_PIN_11);
    rt_interrupt_leave();
}
Example #25
0
void EXTI12_15_Handler(void)
{
    rt_interrupt_enter();
    GPIO_EXTI_Callback(GPIO_PIN_12);
    GPIO_EXTI_Callback(GPIO_PIN_13);
    GPIO_EXTI_Callback(GPIO_PIN_14);
    GPIO_EXTI_Callback(GPIO_PIN_15);
    rt_interrupt_leave();
}
Example #26
0
void USART1_IRQHandler(void) {
    struct usart_dev* usart_dev = Serial1.c_dev();

    rt_interrupt_enter();
    if (usart_dev->regs->SR & USART_SR_RXNE) {
        rt_hw_serial_isr(&serial1, RT_SERIAL_EVENT_RX_IND);
    }
    rt_interrupt_leave();
}
Example #27
0
/**
 * This is the timer interrupt service routine.
 */
void rt_hw_timer_handler()
{
	/* enter interrupt */
	rt_interrupt_enter();

	rt_tick_increase();

	/* leave interrupt */
	rt_interrupt_leave();
}
Example #28
0
void UART4_IRQHandler(void)
{
    /* enter interrupt */
    rt_interrupt_enter();

    hw_serial_isr(&uart4_device);

    /* leave interrupt */
    rt_interrupt_leave();
}
Example #29
0
void USART3_IRQHandler(void)
{
    /* enter interrupt */
    rt_interrupt_enter();

    hw_serial_isr(&usart3_device);

    /* leave interrupt */
    rt_interrupt_leave();
}
Example #30
0
/**
 * This is the timer interrupt service routine.
 *
 */
void SysTick_Handler(void)
{
    /* enter interrupt */
    rt_interrupt_enter();

    rt_tick_increase();

    /* leave interrupt */
    rt_interrupt_leave();
}