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

C++ pvTimerGetTimerID函数代码示例

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

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



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

示例1: sj_timer_callback

static void sj_timer_callback(TimerHandle_t t) {
  v7_val_t *cb = (v7_val_t *) pvTimerGetTimerID(t);
  xTimerDelete(t, 0);
  sj_invoke_cb0(s_v7, *cb);
  v7_disown(s_v7, cb);
  free(cb);
}
开发者ID:ifzz,项目名称:smart.js,代码行数:7,代码来源:cc3200_timers.c


示例2: prvTimerCallback

static void prvTimerCallback( TimerHandle_t xExpiredTimer )
{
UBaseType_t *puxVariableToIncrement;
BaseType_t xReturned;

	/* The timer callback just demonstrates it is executing by incrementing a
	variable - the address of which is passed into the timer as its ID.  Obtain
	the address of the variable to increment. */
	puxVariableToIncrement = ( UBaseType_t * ) pvTimerGetTimerID( xExpiredTimer );

	/* Increment the variable to show the timer callback has executed. */
	( *puxVariableToIncrement )++;

	/* If this callback has executed the required number of times, stop the
	timer. */
	if( *puxVariableToIncrement == staticMAX_TIMER_CALLBACK_EXECUTIONS )
	{
		/* This is called from a timer callback so must not block.  See
		http://www.FreeRTOS.org/FreeRTOS-timers-xTimerStop.html */
		xReturned = xTimerStop( xExpiredTimer, staticDONT_BLOCK );

		if( xReturned != pdPASS )
		{
			xErrorOccurred = pdTRUE;
		}
	}
}
开发者ID:radiolok,项目名称:RelayComputer2,代码行数:27,代码来源:StaticAllocation.c


示例3: poll_ip6_addr

static void poll_ip6_addr(TimerHandle_t pxTimer){
    struct netif *netif_arg = (struct netif *) pvTimerGetTimerID( pxTimer ); 
    bool slaac_done = false;

    //0th  address is link local, assume 1th address is SLAAC
    for(int i = 0; i < 4; i++){
        if(netif_arg->ip6_addr[1].addr[i] != 0){
            slaac_done = true;
            break;
        }
    }
    if(slaac_done){
        for(int i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++){
            uart_printf("IPv6 Address %d of interface %c%c set "
                    "to %04hx:%04hx:%04hx:%04hx:%04hx:%04hx:%04hx:%04hx\n",
                    i,
                    netif_arg->name[0], netif_arg->name[1],
                    IP6_ADDR_BLOCK1(&netif_arg->ip6_addr[i]),
                    IP6_ADDR_BLOCK2(&netif_arg->ip6_addr[i]),
                    IP6_ADDR_BLOCK3(&netif_arg->ip6_addr[i]),
                    IP6_ADDR_BLOCK4(&netif_arg->ip6_addr[i]),
                    IP6_ADDR_BLOCK5(&netif_arg->ip6_addr[i]),
                    IP6_ADDR_BLOCK6(&netif_arg->ip6_addr[i]),
                    IP6_ADDR_BLOCK7(&netif_arg->ip6_addr[i]),
                    IP6_ADDR_BLOCK8(&netif_arg->ip6_addr[i]));
        }
        xTimerStop( pxTimer, 0 );
    }
}
开发者ID:GMUCERG,项目名称:xbh,代码行数:29,代码来源:lwip_eth.c


示例4: pvTimerGetTimerID

void IIS328DQ::measure_trampoline(xTimerHandle xTimer)
{
    void *timer_id = pvTimerGetTimerID(xTimer);
	IIS328DQ *dev = (IIS328DQ *)timer_id;

	/* make another measurement */
	dev->measure();
}
开发者ID:SovietUnion1997,项目名称:PhenixPro_Devkit,代码行数:8,代码来源:iis328dq.cpp


示例5: pvTimerGetTimerID

void
PX4FMU::cycle_trampoline(void* xTimer)
{
    void *timer_id = pvTimerGetTimerID(xTimer);
	PX4FMU *dev = reinterpret_cast<PX4FMU *>(timer_id);

	dev->cycle();
}
开发者ID:SovietUnion1997,项目名称:PhenixPro_Devkit,代码行数:8,代码来源:fmu.cpp


示例6: download_timer_cb

static void download_timer_cb(TimerHandle_t xTimer)
{
    int socket_id = (int) pvTimerGetTimerID(xTimer);
    g_ota_timeout = true;
    if (socket_id != -1) {
        close(socket_id);
    }
}
开发者ID:Esp-Doc,项目名称:esp-iot-solution,代码行数:8,代码来源:ota.c


示例7: timer_callback

static void timer_callback( xTimerHandle handle )
{
    wiced_timer_t* timer = (wiced_timer_t*) pvTimerGetTimerID( handle );

    if ( timer->function )
    {
        timer->function( timer->arg );
    }
}
开发者ID:fishbaoz,项目名称:wiced-emw3165,代码行数:9,代码来源:wiced_rtos.c


示例8: app_timer_callback

/**
 * @brief Internal callback function for the system timer
 *
 * Internal function that is called from the system timer.
 * It gets our parameter from timer data and sends it to user function.
 * @param[in] xTimer Timer handler
 */
static void app_timer_callback(TimerHandle_t xTimer)
{
    app_timer_info_t * pinfo = (app_timer_info_t*)(pvTimerGetTimerID(xTimer));
    ASSERT(pinfo->osHandle == xTimer);
    ASSERT(pinfo->func != NULL);

    if (pinfo->active)
        pinfo->func(pinfo->argument);
}
开发者ID:AaltoNEPPI,项目名称:nRF52_dev,代码行数:16,代码来源:app_timer_freertos.c


示例9: xPortRaisePrivilege

	void *MPU_pvTimerGetTimerID( const TimerHandle_t xTimer )
	{
	void * pvReturn;
	BaseType_t xRunningPrivileged = xPortRaisePrivilege();

		pvReturn = pvTimerGetTimerID( xTimer );
		vPortResetPrivilege( xRunningPrivileged );

		return pvReturn;
	}
开发者ID:sean93park,项目名称:freertos,代码行数:10,代码来源:mpu_wrappers.c


示例10: prvLEDTimerCallback

static void prvLEDTimerCallback( TimerHandle_t xTimer )
{
unsigned long ulLED;

	/* This callback is shared by two timers, so the parameter is used to
	determine which LED to toggle.  The LED number is stored in the ID of the
	timer. */
	ulLED = ( unsigned long ) pvTimerGetTimerID( xTimer );
	vParTestToggleLED( ulLED );
}
开发者ID:Eclo,项目名称:FreeRTOS,代码行数:10,代码来源:main-full.c


示例11: prvLEDTimerCallback

static void prvLEDTimerCallback( xTimerHandle xTimer )
{
portBASE_TYPE xTimerID;

	/* The timer ID is used to identify the timer that has actually expired as
	each timer uses the same callback.  The ID is then also used as the number
	of the LED that is to be toggled. */
	xTimerID = ( portBASE_TYPE ) pvTimerGetTimerID( xTimer );
	vParTestToggleLED( xTimerID );
}
开发者ID:InSoonPark,项目名称:FreeRTOS,代码行数:10,代码来源:flash_timer.c


示例12: prvFlashTimerCallback

static void prvFlashTimerCallback( xTimerHandle xTimer )
{
unsigned long ulLED;

	/* This callback function is assigned to three separate software timers.
	Each timer toggles a different LED.  Obtain the number of the LED that
	this timer is toggling. */
	ulLED = ( unsigned long ) pvTimerGetTimerID( xTimer );

	/* Toggle the LED. */
	vParTestToggleLED( ulLED );	
}
开发者ID:bookie,项目名称:freertos,代码行数:12,代码来源:main-full.c


示例13: prvTimerCallback

static void prvTimerCallback( TaskHandle_t xExpiredTimer )
{
uint32_t ulCount;

	/* The count of the number of times this timer has expired is saved in the
	timer's ID.  Obtain the current count. */
	ulCount = ( uint32_t ) pvTimerGetTimerID( xTimer );

	/* Increment the count, and save it back into the timer's ID. */
	ulCount++;
	vTimerSetTimerID( xTimer, ( void * ) ulCount );
}
开发者ID:sean93park,项目名称:freertos,代码行数:12,代码来源:main.c


示例14: vTimerCallback

void vTimerCallback ( xTimerHandle pxTimer )
{
	configASSERT( pxTimer );

	// Which timer expired?
	long lTimerID = ( long ) pvTimerGetTimerID ( pxTimer );

	if ( lTimerID < LED_NUM_TIMER ) LedTimerCallback ( lTimerID );
	else switch ( lTimerID )
	{
	case 4:
		disk_timerproc ( );
		return;
	};
};
开发者ID:hosentraeger,项目名称:STM32F4D-Coocox-Lightboxx,代码行数:15,代码来源:main.c


示例15: prvTimerCallback

static void prvTimerCallback( TaskHandle_t xExpiredTimer )
{
uint32_t ulCount;

	/* The count of the number of times this timer has expired is saved in the
	timer's ID.  Obtain the current count. */
	ulCount = ( uint32_t ) pvTimerGetTimerID( xTimer );

	/* Increment the count, and save it back into the timer's ID. */
	ulCount++;
	vTimerSetTimerID( xTimer, ( void * ) ulCount );

	/* Let the check task know the timer is still running. */
	vMainSendImAlive( xGlobalScopeCheckQueue, configTIMER_STILL_EXECUTING );
}
开发者ID:Eclo,项目名称:FreeRTOS,代码行数:15,代码来源:main.c


示例16: LCDTimerCallback

// Callback function that is called by the LCDTimer
//   Sends a message to the queue that is read by the LCD Task
void LCDTimerCallback(xTimerHandle pxTimer)
{
	if (pxTimer == NULL) {
		VT_HANDLE_FATAL_ERROR(0);
	} else {
		// When setting up this timer, I put the pointer to the 
		//   LCD structure as the "timer ID" so that I could access
		//   that structure here -- which I need to do to get the 
		//   address of the message queue to send to 
		vtLCDStruct *ptr = (vtLCDStruct *) pvTimerGetTimerID(pxTimer);
		// Make this non-blocking *but* be aware that if the queue is full, this routine
		// will not care, so if you care, you need to check something
		if (SendLCDTimerMsg(ptr,lcdWRITE_RATE_BASE,0) == errQUEUE_FULL) {
			// Here is where you would do something if you wanted to handle the queue being full
			VT_HANDLE_FATAL_ERROR(0);
		}
	}
}
开发者ID:nbjones,项目名称:RTOSDemo,代码行数:20,代码来源:myTimers.c


示例17: prvUIPTimerCallback

static void prvUIPTimerCallback( TimerHandle_t xTimer )
{
static const unsigned long ulARPTimerExpired = uipARP_TIMER_EVENT;
static const unsigned long ulPeriodicTimerExpired = uipPERIODIC_TIMER_EVENT;

	/* This is a time callback, so calls to xQueueSend() must not attempt to
	block. */
	switch( ( int ) pvTimerGetTimerID( xTimer ) )
	{
		case uipARP_TIMER		:	xQueueSend( xEMACEventQueue, &ulARPTimerExpired, uipDONT_BLOCK );
									break;

		case uipPERIODIC_TIMER	:	xQueueSend( xEMACEventQueue, &ulPeriodicTimerExpired, uipDONT_BLOCK );
									break;

		default					:  	/* Should not get here. */
									break;
	}
}
开发者ID:AlexShiLucky,项目名称:freertos,代码行数:19,代码来源:uIP_Task.c


示例18: adcTimerCallback

// Callback function that is called by the TemperatureTimer
//   Sends a message to the queue that is read by the Temperature Task
void adcTimerCallback(xTimerHandle pxTimer)
{
	if (pxTimer == NULL) {
		VT_HANDLE_FATAL_ERROR(0);
	} else {
		// When setting up this timer, I put the pointer to the 
		//   Temperature structure as the "timer ID" so that I could access
		//   that structure here -- which I need to do to get the 
		//   address of the message queue to send to 
		adcStruct *ptr = (adcStruct *) pvTimerGetTimerID(pxTimer);
		// Make this non-blocking *but* be aware that if the queue is full, this routine
		// will not care, so if you care, you need to check something
		GPIO_SetValue(0,0x8000);
		if (SendadcTimerMsg(ptr) == errQUEUE_FULL) {
			// Here is where you would do something if you wanted to handle the queue being full
			VT_HANDLE_FATAL_ERROR(0);
		}
		GPIO_ClearValue(0,0x8000);
	}
}
开发者ID:nbjones,项目名称:RTOSDemo,代码行数:22,代码来源:myTimers.c


示例19: prvUIPTimerCallback

static void prvUIPTimerCallback( xTimerHandle xTimer )
{
static const unsigned long ulARPTimerExpired = uipARP_TIMER_EVENT;
static const unsigned long ulPeriodicTimerExpired = uipPERIODIC_TIMER_EVENT;

	/* This is a time callback, so calls to xQueueSend() must not attempt to
	block.  As this callback is assigned to both the ARP and Periodic timers, the
	first thing to do is ascertain which timer it was that actually expired. */
	switch( ( int ) pvTimerGetTimerID( xTimer ) )
	{
		case uipARP_TIMER		:	xQueueSend( xEMACEventQueue, &ulARPTimerExpired, uipDONT_BLOCK );
									break;

		case uipPERIODIC_TIMER	:	xQueueSend( xEMACEventQueue, &ulPeriodicTimerExpired, uipDONT_BLOCK );
									break;

		default					:  	/* Should not get here. */
									break;
	}
}
开发者ID:ammarkham,项目名称:moos,代码行数:20,代码来源:uIP_Task.c


示例20: runLedseq

/* Center of the led sequence machine. This function is executed by the FreeRTOS
 * timer and runs the sequences
 */
static void runLedseq( xTimerHandle xTimer )
{
  led_t led = (led_t)pvTimerGetTimerID(xTimer);
  const ledseq_t *step;
  bool leave=false;

  if (!ledseqEnabled)
    return;

  while(!leave) {
    int prio = activeSeq[led];

    if (prio == LEDSEQ_STOP)
      return;

    step = &sequences[prio][state[led][prio]];

    state[led][prio]++;

    xSemaphoreTake(ledseqSem, portMAX_DELAY);
    switch(step->action)
    {
      case LEDSEQ_LOOP:
        state[led][prio] = 0;
        break;
      case LEDSEQ_STOP:
        state[led][prio] = LEDSEQ_STOP;
        updateActive(led);
        break;
      default:  //The step is a LED action and a time
        ledSet(led, step->value);
        if (step->action == 0)
          break;
        xTimerChangePeriod(xTimer, M2T(step->action), 0);
        xTimerStart(xTimer, 0);
        leave=true;
        break;
    }
    xSemaphoreGive(ledseqSem);
  }
}
开发者ID:CarlosRDomin,项目名称:crazyflie-firmware,代码行数:44,代码来源:ledseq.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ pv_get_null函数代码示例发布时间:2022-05-30
下一篇:
C++ pvPortMalloc函数代码示例发布时间: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