当前位置: 首页>>代码示例>>C++>>正文


C++ rt_interrupt_enter函数代码示例

本文整理汇总了C++中rt_interrupt_enter函数的典型用法代码示例。如果您正苦于以下问题:C++ rt_interrupt_enter函数的具体用法?C++ rt_interrupt_enter怎么用?C++ rt_interrupt_enter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了rt_interrupt_enter函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: UART4_IRQHandler

void UART4_IRQHandler(void)
{
	extern void uart4_interrupt_handler(void);
	rt_interrupt_enter();
	uart4_interrupt_handler();
	rt_interrupt_leave();
}
开发者ID:cvrobot,项目名称:deepblueplane,代码行数:7,代码来源:stm32f4xx_it.c

示例2: UART0_RX_TX_IRQHandler

/* 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();
}
开发者ID:RT-Thread,项目名称:rtthread_fsl,代码行数:8,代码来源:fsl_uart_irq_rt.c

示例3: EXTI1_IRQHandler

void EXTI1_IRQHandler(void)
{
	extern void adxl_isr_handle(void);
	rt_interrupt_enter();
	adxl_isr_handle();
	rt_interrupt_leave();
}
开发者ID:cvrobot,项目名称:deepblueplane,代码行数:7,代码来源:stm32f4xx_it.c

示例4: URT01_IRQHandler

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 */
}
开发者ID:aozima,项目名称:rt-thread,代码行数:25,代码来源:uart_dev.c

示例5: EXTI2_IRQHandler

void EXTI2_IRQHandler(void)
{
	extern void hmc_isr_handle(void);
	rt_interrupt_enter();
	hmc_isr_handle();
	rt_interrupt_leave();
}
开发者ID:cvrobot,项目名称:deepblueplane,代码行数:7,代码来源:stm32f4xx_it.c

示例6: rt_fh_uart_handler

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();
    }
}
开发者ID:hezlog,项目名称:rt-thread,代码行数:32,代码来源:uart.c

示例7: ETH_IRQHandler

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();
}
开发者ID:54chenjq,项目名称:rt-thread,代码行数:32,代码来源:emac.c

示例8: TIM7_IRQHandler

void TIM7_IRQHandler(void)
{
	extern void tim7_isr_handle(void);
	rt_interrupt_enter();
	tim7_isr_handle();
	rt_interrupt_leave();	
}
开发者ID:cvrobot,项目名称:deepblueplane,代码行数:7,代码来源:stm32f4xx_it.c

示例9: TIMER3_IRQHandler

void TIMER3_IRQHandler(void)
{
	 rt_interrupt_enter();
   ts_tick ++;
   LPC_TIM3->IR |= TIM_IR_MR0;         /* clear interrupt */
	 rt_interrupt_leave();
}
开发者ID:nongxiaoming,项目名称:RealBoard4088,代码行数:7,代码来源:rti_stub_lpc.c

示例10: rt_hw_timer_handler

/**
 * 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();
}
开发者ID:malooei,项目名称:yeejoin-workspace,代码行数:30,代码来源:board.c

示例11: DMA1_Channel7_IRQHandler

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);
	}
}
开发者ID:KONGLZ123,项目名称:TPDT.FC_407,代码行数:26,代码来源:i2c1.c

示例12: USART3_IRQHandler

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();
}
开发者ID:pengleo392,项目名称:FreeModbus_Slave-Master-RTT-STM32,代码行数:30,代码来源:usart.c

示例13: uart_isr

/**
 * 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();
}
开发者ID:geniusgogo,项目名称:rt-thread,代码行数:37,代码来源:drv_uart.c

示例14: USART3_IRQHandler

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();
}
开发者ID:wuzeguang,项目名称:SingleChipMicrocomputer,代码行数:60,代码来源:it.c

示例15: EXTI0_IRQHandler

void EXTI0_IRQHandler(void)
{
	extern void gyro_isr_handle(void);
	rt_interrupt_enter();
	gyro_isr_handle();
	rt_interrupt_leave();
}
开发者ID:cvrobot,项目名称:deepblueplane,代码行数:7,代码来源:stm32f4xx_it.c


注:本文中的rt_interrupt_enter函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。