• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ portSET_INTERRUPT_MASK_FROM_ISR函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: EXTI0_IRQHandler

void EXTI0_IRQHandler(void) {
	if (EXTI_GetITStatus(EXTI_Line0 ) != RESET) {
		portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
		unsigned long ulDummy;
		ulDummy = portSET_INTERRUPT_MASK_FROM_ISR();
		{
			uint8_t buffer[6];
			LIS302DL_Read(buffer, LIS302DL_OUT_X_ADDR, 6);
			xQueueSendFromISR(queue, &(buffer[4]), &xHigherPriorityTaskWoken);
			EXTI_ClearITPendingBit(EXTI_Line0 );
		}
		portCLEAR_INTERRUPT_MASK_FROM_ISR( ulDummy);
		portEND_SWITCHING_ISR(xHigherPriorityTaskWoken);
	}
}
开发者ID:nraynaud,项目名称:DiscoveryF4_RTOS,代码行数:15,代码来源:main.c


示例2: xPortSysTickHandler

/**
 * \brief Handler for Sytem Tick interrupt.
 */
void xPortSysTickHandler(void)
{
	unsigned portLONG ulDummy;

	/* If using preemption, also force a context switch. */
#if configUSE_PREEMPTION == 1
	*(portNVIC_INT_CTRL) = portNVIC_PENDSVSET;
#endif

	ulDummy = portSET_INTERRUPT_MASK_FROM_ISR();
	{
		vTaskIncrementTick();
	}
	portCLEAR_INTERRUPT_MASK_FROM_ISR(ulDummy);
}
开发者ID:Arseny-N,项目名称:dylan,代码行数:18,代码来源:port.c


示例3: xPortSysTickHandler

void xPortSysTickHandler( void )
{
uint32_t ulPreviousMask;
        NRF_RTC1->EVENTS_TICK = 0;
	ulPreviousMask = portSET_INTERRUPT_MASK_FROM_ISR();
	{
		/* Increment the RTOS tick. */
		if( xTaskIncrementTick() != pdFALSE )
		{
			/* Pend a context switch. */
			*(portNVIC_INT_CTRL) = portNVIC_PENDSVSET;
		}
	}
	portCLEAR_INTERRUPT_MASK_FROM_ISR( ulPreviousMask );
}
开发者ID:ClarePhang,项目名称:FreeRTOS8.0.1-nrf51-softdevice,代码行数:15,代码来源:port.c


示例4: __attribute__

void __attribute__ ((interrupt)) __cs3_isr_interrupt_119( void )
{
unsigned portLONG ulSavedInterruptMask;

	/* Clear the PIT0 interrupt. */
	MCF_PIT0_PCSR |= MCF_PIT_PCSR_PIF;

	/* Increment the RTOS tick. */
	ulSavedInterruptMask = portSET_INTERRUPT_MASK_FROM_ISR();
		if( xTaskIncrementTick() != pdFALSE )
		{
			taskYIELD();
		}
	portCLEAR_INTERRUPT_MASK_FROM_ISR( ulSavedInterruptMask );
}
开发者ID:LinuxJohannes,项目名称:FreeRTOS,代码行数:15,代码来源:FreeRTOS_Tick_Setup.c


示例5: xPortSysTickHandler

void xPortSysTickHandler( void )
{
uint32_t ulDummy;

	ulDummy = portSET_INTERRUPT_MASK_FROM_ISR();
	{
		/* Increment the RTOS tick. */
		if( xTaskIncrementTick() != pdFALSE )
		{
			/* Pend a context switch. */
			*(portNVIC_INT_CTRL) = portNVIC_PENDSVSET;
		}
	}
	portCLEAR_INTERRUPT_MASK_FROM_ISR( ulDummy );
}
开发者ID:AskDrCatcher,项目名称:FreeRTOS,代码行数:15,代码来源:port.c


示例6: xPortSysTickHandler

void xPortSysTickHandler( void )
{
unsigned long ulPreviousMask;

	ulPreviousMask = portSET_INTERRUPT_MASK_FROM_ISR();
	{
		/* Increment the RTOS tick. */
		if( xTaskIncrementTick() != pdFALSE )
		{
			/* Pend a context switch. */
			*(portNVIC_INT_CTRL) = portNVIC_PENDSVSET;
		}
	}
	portCLEAR_INTERRUPT_MASK_FROM_ISR( ulPreviousMask );
}
开发者ID:Bosvark,项目名称:STM32Cube_FW_F4_V1.1.0,代码行数:15,代码来源:port.c


示例7: ulMainGetRunTimeCounterValue

unsigned long ulMainGetRunTimeCounterValue( void )
{
unsigned long ulSysTickCounts, ulTickCount, ulReturn;
const unsigned long ulSysTickReloadValue = ( configCPU_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL;
volatile unsigned long * const pulCurrentSysTickCount = ( ( volatile unsigned long *) 0xe000e018 );
volatile unsigned long * const pulInterruptCTRLState = ( ( volatile unsigned long *) 0xe000ed04 );
const unsigned long ulSysTickPendingBit = 0x04000000UL;

	/* NOTE: There are potentially race conditions here.  However, it is used
	anyway to keep the examples simple, and to avoid reliance on a separate
	timer peripheral. */


	/* The SysTick is a down counter.  How many clocks have passed since it was
	last reloaded? */
	ulSysTickCounts = ulSysTickReloadValue - *pulCurrentSysTickCount;

	/* How many times has it overflowed? */
	ulTickCount = xTaskGetTickCountFromISR();

	/* This is called from the context switch, so will be called from a
	critical section.  xTaskGetTickCountFromISR() contains its own critical
	section, and the ISR safe critical sections are not designed to nest,
	so reset the critical section. */
	portSET_INTERRUPT_MASK_FROM_ISR();

	/* Is there a SysTick interrupt pending? */
	if( ( *pulInterruptCTRLState & ulSysTickPendingBit ) != 0UL )
	{
		/* There is a SysTick interrupt pending, so the SysTick has overflowed
		but the tick count not yet incremented. */
		ulTickCount++;

		/* Read the SysTick again, as the overflow might have occurred since
		it was read last. */
		ulSysTickCounts = ulSysTickReloadValue - *pulCurrentSysTickCount;
	}

	/* Convert the tick count into tenths of a millisecond.  THIS ASSUMES
	configTICK_RATE_HZ is 1000! */
	ulReturn = ( ulTickCount * 10UL ) ;

	/* Add on the number of tenths of a millisecond that have passed since the
	tick count last got updated. */
	ulReturn += ( ulSysTickCounts / ulClocksPer10thOfAMilliSecond );

	return ulReturn;
}
开发者ID:Eclo,项目名称:FreeRTOS,代码行数:48,代码来源:main-full.c


示例8: xEventGroupGetBitsFromISR

EventBits_t xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup )
{
UBaseType_t uxSavedInterruptStatus;
EventGroup_t *pxEventBits = ( EventGroup_t * ) xEventGroup;
EventBits_t uxReturn;

	taskENTER_CRITICAL();
	uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();
	{
		uxReturn = pxEventBits->uxEventBits;
	}
//	portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );
	taskEXIT_CRITICAL();

	return uxReturn;
}
开发者ID:nonarkitten,项目名称:freertos_coldfire,代码行数:16,代码来源:event_groups.c


示例9: FIFO_PutFromISR

/**************************************************************************//**
 * @brief		Schreibt von ISR aus ein Byte in FIFO
 *
 * @param[in, out]	pFIFO								FIFO
 * @param[in]	b										Datum
 *
 * @return      true - Alles OK, false - kein Platz im FIFO
 */
bool	FIFO_PutFromISR(pT_ByteFIFO pFIFO, uint8_t b)
{
uint32_t Next = (((T_ByteFIFO*)pFIFO)->Head + 1) % ((T_ByteFIFO*)pFIFO)->Size;

	if (Next == ((T_ByteFIFO*)pFIFO)->Tail)							// Voll ?
		return false;									// Ende!

uint32_t SavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();

		((T_ByteFIFO*)pFIFO)->Buffer[((T_ByteFIFO*)pFIFO)->Head] = b;					// Byte rein
		((T_ByteFIFO*)pFIFO)->Head = Next;

		portCLEAR_INTERRUPT_MASK_FROM_ISR(SavedInterruptStatus);

	return true;
}
开发者ID:DL7AD,项目名称:pecan-lpc11xx,代码行数:24,代码来源:fifo.c


示例10: xPortSysTickHandler

void xPortSysTickHandler( void )
{
unsigned long ulDummy;

	ulDummy = portSET_INTERRUPT_MASK_FROM_ISR();
	{
		vTaskIncrementTick();
	}
	portCLEAR_INTERRUPT_MASK_FROM_ISR( ulDummy );

	/* If using preemption, also force a context switch. */
	#if configUSE_PREEMPTION == 1
		*(portNVIC_INT_CTRL) = portNVIC_PENDSVSET;
		portINTERRUPT_CORE( (~portTICKEXE_CORENUM) & 0x1 );
	#endif
}
开发者ID:HackLinux,项目名称:freertos-multicore,代码行数:16,代码来源:port.c


示例11: vParTestSetLEDFromISR

void vParTestSetLEDFromISR( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue )
{
    unsigned portBASE_TYPE uxInterruptFlags;

    uxInterruptFlags = portSET_INTERRUPT_MASK_FROM_ISR();
    {
        if( uxLED < partstMAX_LEDS ) {
            if( xValue == pdTRUE ) {
                FM3_GPIO->PDOR3 &= ~( 1UL << ( uxLED + partstLED_0_OFFSET ) );
            } else {
                FM3_GPIO->PDOR3 |= ( 1UL << ( uxLED + partstLED_0_OFFSET ) );
            }
        }
    }
    portCLEAR_INTERRUPT_MASK_FROM_ISR( uxInterruptFlags );
}
开发者ID:peterliu2,项目名称:FreeRTOS,代码行数:16,代码来源:ParTest.c


示例12: FIFO_GetFromISR

/**************************************************************************//**
 * @brief		Liest von ISR aus ein Byte aus FIFO
 *
 * @param[in, out]	pFIFO								FIFO
 * @param[out]	pb										Datum
 *
 * @return      true - Alles OK in pB steht Datum, false - FIFO ist leer
 */
bool	FIFO_GetFromISR(pT_ByteFIFO pFIFO, uint8_t *pb)
{
	if (((T_ByteFIFO*)pFIFO)->Head == ((T_ByteFIFO*)pFIFO)->Tail)						// Leer
		return false;									// Ende!

uint32_t Next = (((T_ByteFIFO*)pFIFO)->Tail + 1) % ((T_ByteFIFO*)pFIFO)->Size;

uint32_t SavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();

		*pb = ((T_ByteFIFO*)pFIFO)->Buffer[((T_ByteFIFO*)pFIFO)->Tail];					// Byte raus
		((T_ByteFIFO*)pFIFO)->Tail = Next;

		portCLEAR_INTERRUPT_MASK_FROM_ISR(SavedInterruptStatus);

	return true;
}
开发者ID:DL7AD,项目名称:pecan-lpc11xx,代码行数:24,代码来源:fifo.c


示例13: TIM6_IRQHandler

void TIM6_IRQHandler(void)//1ms
{
	static uint16_t count_1s = 0;

	unsigned portBASE_TYPE uxSavedInterruptStatus;
	uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();
//	
//	count++;
//	if(count >= 10) 
//	{
//		count = 0;
//		uip_timer++;		//uip计时器增加1
//	}
//	if(TIM6->SR & 0X0001)	//溢出中断
#if ARM_MINI
	scan_led();
#endif	
	if(TIM_GetFlagStatus(TIM6, TIM_IT_Update) == SET)
	{
		uip_timer++;		//uip计时器增加1
	}
	
	
	miliseclast = miliseclast + SWTIMER_INTERVAL;  // 1ms

	if(count_1s < 1000 / SWTIMER_INTERVAL)
	{
		count_1s++;
	}
	else	
	{
		run_time++;
#if 0
	  timestart++;
#endif
		count_1s = 0;
	}
	SilenceTime = SilenceTime + SWTIMER_INTERVAL;
	if(SilenceTime > 10000)	
	{
		SilenceTime = 0;
	}	
//	TIM6->SR &= ~(1 << 0);	//清除中断标志位 
	TIM_ClearFlag(TIM6, TIM_IT_Update);		
	
	portCLEAR_INTERRUPT_MASK_FROM_ISR(uxSavedInterruptStatus);
}
开发者ID:temcocontrols,项目名称:CM5,代码行数:47,代码来源:timerx.c


示例14: xPortSysTickHandler

void xPortSysTickHandler( void )
{
    nrf_rtc_event_clear(portNRF_RTC_REG, NRF_RTC_EVENT_TICK);
#if configUSE_TICKLESS_IDLE == 1
    nrf_rtc_event_clear(portNRF_RTC_REG, NRF_RTC_EVENT_COMPARE_0);
#endif
    uint32_t isrstate = portSET_INTERRUPT_MASK_FROM_ISR();
    /* Increment the RTOS tick. */
    if ( xTaskIncrementTick() != pdFALSE )
    {
        /* A context switch is required.  Context switching is performed in
        the PendSV interrupt.  Pend the PendSV interrupt. */
        SCB->ICSR = SCB_ICSR_PENDSVSET_Msk;
        __SEV();
    }
    portCLEAR_INTERRUPT_MASK_FROM_ISR( isrstate );
}
开发者ID:lyncxy119,项目名称:Sentry,代码行数:17,代码来源:port_cmsis_systick.c


示例15: xPortSysTickHandler

void xPortSysTickHandler( void )
{
    /* The SysTick runs at the lowest interrupt priority, so when this interrupt
    executes all interrupts must be unmasked.  There is therefore no need to
    save and then restore the interrupt mask value as its value is already
    known. */
    ( void ) portSET_INTERRUPT_MASK_FROM_ISR();
    {
        /* Increment the RTOS tick. */
        if( xTaskIncrementTick() != pdFALSE ) {
            /* A context switch is required.  Context switching is performed in
            the PendSV interrupt.  Pend the PendSV interrupt. */
            portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;
        }
    }
    portCLEAR_INTERRUPT_MASK_FROM_ISR( 0 );
}
开发者ID:autosportlabs,项目名称:RaceCapture-Pro_firmware,代码行数:17,代码来源:port.c


示例16: vPortTickISR

void interrupt VectorNumber_Vrtc vPortTickISR( void )
{
uint32_t ulSavedInterruptMask;

	/* Clear the interrupt. */
	RTCSC |= RTCSC_RTIF_MASK;

	/* Increment the RTOS tick. */
	ulSavedInterruptMask = portSET_INTERRUPT_MASK_FROM_ISR();
	{
		if( xTaskIncrementTick() != pdFALSE )
		{
			taskYIELD();
		}
	}
	portCLEAR_INTERRUPT_MASK_FROM_ISR( ulSavedInterruptMask );
}
开发者ID:RGassmann,项目名称:FRDM,代码行数:17,代码来源:port.c


示例17: vNetworkBufferReleaseFromISR

BaseType_t vNetworkBufferReleaseFromISR( xNetworkBufferDescriptor_t * const pxNetworkBuffer )
{
    UBaseType_t uxSavedInterruptStatus;
    BaseType_t xHigherPriorityTaskWoken = pdFALSE;

    /* Ensure the buffer is returned to the list of free buffers before the
    counting semaphore is 'given' to say a buffer is available. */
    uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();
    {
        vListInsertEnd( &xFreeBuffersList, &( pxNetworkBuffer->xBufferListItem ) );
    }
    portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );

    xSemaphoreGiveFromISR( xNetworkBufferSemaphore, &xHigherPriorityTaskWoken );
    iptraceNETWORK_BUFFER_RELEASED( pxNetworkBuffer );

    return xHigherPriorityTaskWoken;
}
开发者ID:peterliu2,项目名称:FreeRTOS,代码行数:18,代码来源:BufferAllocation_1.c


示例18: xPortSysTickHandler

void xPortSysTickHandler( void )
{
unsigned long ulDummy;

	/* If using preemption, also force a context switch. */
	#if configUSE_PREEMPTION == 1
		*(portNVIC_INT_CTRL) = portNVIC_PENDSVSET;
	#endif

	ulDummy = portSET_INTERRUPT_MASK_FROM_ISR();
	{
		//GPIOB->BSRRH = GPIO_BSRR_BS_0;
		powerStateCheck();
		//GPIOB->BSRRL = GPIO_BSRR_BS_0;
		vTaskIncrementTick();
	}
	portCLEAR_INTERRUPT_MASK_FROM_ISR( ulDummy );
}
开发者ID:dlebed,项目名称:stm32l_freertos_ir_thermo,代码行数:18,代码来源:port.c


示例19: osPoolFree

/// Return an allocated memory block back to a specific memory pool
/// \param[in]     pool_id       memory pool ID obtain referenced with \ref osPoolCreate.
/// \param[in]     block         address of the allocated memory block that is returned to the memory pool.
/// \return status code that indicates the execution status of the function.
/// \note MUST REMAIN UNCHANGED: \b osPoolFree shall be consistent in every CMSIS-RTOS.
osStatus osPoolFree (osPoolId pool_id, void *block)
{
    int dummy;
    uint32_t index;

    if (pool_id == NULL) {
        return osErrorParameter;
    }

    if (block == NULL) {
        return osErrorParameter;
    }

    if (block < pool_id->pool) {
        return osErrorParameter;
    }

    index = (uint32_t)block - (uint32_t)(pool_id->pool);
    if (index % pool_id->item_sz) {
        return osErrorParameter;
    }
    index = index / pool_id->item_sz;
    if (index >= pool_id->pool_sz) {
        return osErrorParameter;
    }

    if (inHandlerMode()) {
        dummy = portSET_INTERRUPT_MASK_FROM_ISR();
    }
    else {
        vPortEnterCritical();
    }

    pool_id->markers[index] = 0;

    if (inHandlerMode()) {
        portCLEAR_INTERRUPT_MASK_FROM_ISR(dummy);
    }
    else {
        vPortExitCritical();
    }

    return osOK;
}
开发者ID:geliang201201,项目名称:RTL_Ameba,代码行数:49,代码来源:cmsis_os.c


示例20: xPortSysTickHandler

/**
 * @brief	Tick interrupt handler routine
 * @return	Nothing
 * @note	This function handles the tick interrupts that are generated by RITIMER.
 */
void xPortSysTickHandler(void)
{
	unsigned long ulDummy;

	/* TODO: check if WWDT interrupt and redirect */
	Chip_RIT_ClearInt(LPC_RITIMER);
	Chip_RIT_SetCOMPVAL(LPC_RITIMER, Chip_RIT_GetCounter(LPC_RITIMER) + reload_val);/* Reload value */

#if configUSE_PREEMPTION == 1
	/* If using preemption, also force a context switch. */
	*(portNVIC_INT_CTRL) = portNVIC_PENDSVSET;
#endif

	ulDummy = portSET_INTERRUPT_MASK_FROM_ISR();
	{
		vTaskIncrementTick();
	}
	portCLEAR_INTERRUPT_MASK_FROM_ISR(ulDummy);
}
开发者ID:Andriiy,项目名称:Circuit-Boards,代码行数:24,代码来源:FreeRTOS_lpc43xx_m0_Tick.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ portSWITCH_CONTEXT函数代码示例发布时间:2022-05-30
下一篇:
C++ portSAVE_CONTEXT函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap