您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ xTimerCreate函数代码示例

51自学网 2021-06-03 10:14:49
  C++
这篇教程C++ xTimerCreate函数代码示例写得很实用,希望能帮到您。

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

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

示例1: main_full

void main_full( void ){xTimerHandle xCheckTimer = NULL;	/* Start all the other standard demo/test tasks.  The have not particular	functionality, but do demonstrate how to use the FreeRTOS API and test the	kernel port. */	vStartIntegerMathTasks( tskIDLE_PRIORITY );	vStartDynamicPriorityTasks();	vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );	vCreateBlockTimeTasks();	vStartCountingSemaphoreTasks();	vStartGenericQueueTasks( tskIDLE_PRIORITY );	vStartRecursiveMutexTasks();	vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );	vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );	vStartMathTasks( mainFLOP_TASK_PRIORITY );		/* Create the register check tasks, as described at the top of this	file */	xTaskCreate( vRegTest1Task, ( signed char * ) "Reg1", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );	xTaskCreate( vRegTest2Task, ( signed char * ) "Reg2", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );	/* Create the software timer that performs the 'check' functionality,	as described at the top of this file. */	xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */								( mainCHECK_TIMER_PERIOD_MS ),		/* The timer period, in this case 3000ms (3s). */								pdTRUE,								/* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */								( void * ) 0,						/* The ID is not used, so can be set to anything. */								prvCheckTimerCallback				/* The callback function that inspects the status of all the other tasks. */							  );			if( xCheckTimer != NULL )	{		xTimerStart( xCheckTimer, mainDONT_BLOCK );	}	/* The set of tasks created by the following function call have to be 	created last as they keep account of the number of tasks they expect to see 	running. */	vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );	/* Start the scheduler. */	vTaskStartScheduler();		/* If all is well, the scheduler will now be running, and the following line	will never be reached.  If the following line does execute, then there was	insufficient FreeRTOS heap memory available for the idle and/or timer tasks	to be created.  See the memory management section on the FreeRTOS web site	for more details. */	for( ;; )	{		__asm volatile( "NOP" );	}}
开发者ID:InSoonPark,项目名称:FreeRTOS,代码行数:55,


示例2: buzzerInit

static void buzzerInit(DeckInfo *info){  piezoInit();  neffect = sizeof(effects)/sizeof(effects[0])-1;  nmelody = sizeof(melodies)/sizeof(melodies[0])-1;  timer = xTimerCreate( "buzztimer", M2T(10),                                     pdTRUE, NULL, buzzTimer );  xTimerStart(timer, 100);}
开发者ID:guygrigsby,项目名称:crazyflie-firmware,代码行数:11,


示例3: timer_initialize

// Initializes timer to specified period in msvoid timer_initialize(int ms){    TimerHandle_t myTimer1;    myTimer1 = xTimerCreate("test",                           (ms/portTICK_PERIOD_MS),                           pdTRUE,                            (void *)0,                           timerCallback);    if (xTimerStart(myTimer1,10) == pdFAIL)        error('a');}
开发者ID:skitty1213,项目名称:team3-terrorsofembedded,代码行数:12,


示例4: xTimerCreate

FreeRTOSTimer::FreeRTOSTimer(tmrTIMER_CALLBACK pFunction, TIME_MS t, TimerType type){	// xTimerCreate() copies the pointer for the name, so the tName variable	// cannot simply be on the stack, it should be global or static	static signed char tName[] = "Tmr";	mTimerHandle = xTimerCreate(tName, OS_MS(t),								type == TimerOneShot ? pdFALSE : pdTRUE,								0,								pFunction);}
开发者ID:Bento007,项目名称:cmpe_127_SJSU_F12_Project,代码行数:11,


示例5: osTimerCreate

/// Create a timer./// /param[in]     timer_def     timer object referenced with /ref osTimer./// /param[in]     type          osTimerOnce for one-shot or osTimerPeriodic for periodic behavior./// /param[in]     argument      argument to the timer call back function./// /return timer ID for reference by other functions or NULL in case of error./// /note MUST REMAIN UNCHANGED: /b osTimerCreate shall be consistent in every CMSIS-RTOS.osTimerId osTimerCreate (const osTimerDef_t *timer_def, os_timer_type type, void *argument){    timer_def->custom->argument = argument;    return xTimerCreate((const portCHAR *)"",                        1,  //Set later when timer is started                        (type == osTimerPeriodic) ? pdTRUE : pdFALSE,                        (void *)timer_def,                        _osTimerCallbackFreeRTOS                        );}
开发者ID:geliang201201,项目名称:RTL_Ameba,代码行数:17,


示例6: vTask4

void vTask4(void *pvParameters) {	// Remove compiler warnings.	(void) pvParameters;		xTimer1 = xTimerCreate( "Timer 1",( 4000 ), pdTRUE,( void * ) 41, vTimerCallback1);	xTimerStart(xTimer1,0);		vTaskDelay(2000);	xTimer2 = xTimerCreate( "Timer 2",( 4000 ), pdTRUE,( void * ) 42, vTimerCallback2);	xTimerStart(xTimer2,0);		vTaskDelay(1000);	xTimer3 = xTimerCreate( "Timer 3",( 2000 ), pdTRUE,( void * ) 43, vTimerCallback3);	xTimerStart(xTimer3,0);		while (1) {		vTaskSuspend(NULL);	}	vTaskDelete(NULL);}
开发者ID:jimmi280586,项目名称:asembler,代码行数:20,


示例7: prvOptionallyCreateComprehensveTestApplication

static void prvOptionallyCreateComprehensveTestApplication( void ){	#if ( mainCREATE_SIMPLE_LED_FLASHER_DEMO_ONLY == 0 )	{	xTimerHandle xCheckTimer = NULL;		/* Start all the other standard demo/test tasks. */		vStartIntegerMathTasks( tskIDLE_PRIORITY );		vStartDynamicPriorityTasks();		vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );		vCreateBlockTimeTasks();		vStartCountingSemaphoreTasks();		vStartGenericQueueTasks( tskIDLE_PRIORITY );		vStartRecursiveMutexTasks();		vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );		vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );		/* Most importantly, start the tasks that use the FPU. */		vStartMathTasks( mainFLOP_TASK_PRIORITY );				/* Create the register check tasks, as described at the top of this		file */		xTaskCreate( vRegTest1Task, ( signed char * ) "Reg1", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );		xTaskCreate( vRegTest2Task, ( signed char * ) "Reg2", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );		/* Create the software timer that performs the 'check' functionality,		as described at the top of this file. */		xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */									( mainCHECK_TIMER_PERIOD_MS ),		/* The timer period, in this case 3000ms (3s). */									pdTRUE,								/* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */									( void * ) 0,						/* The ID is not used, so can be set to anything. */									prvCheckTimerCallback				/* The callback function that inspects the status of all the other tasks. */								  );					if( xCheckTimer != NULL )		{			xTimerStart( xCheckTimer, mainDONT_BLOCK );		}		/* This task has to be created last as it keeps account of the number of		tasks it expects to see running. */		vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );	}	#else /* mainCREATE_SIMPLE_LED_FLASHER_DEMO_ONLY */	{		/* Just to prevent compiler warnings when the configuration options are		set such that these static functions are not used. */		( void ) vRegTest1Task;		( void ) vRegTest2Task;		( void ) prvCheckTimerCallback;		( void ) prvSetupNestedFPUInterruptsTest;	}	#endif /* mainCREATE_SIMPLE_LED_FLASHER_DEMO_ONLY */}
开发者ID:Dzenik,项目名称:FreeRTOS_TEST,代码行数:54,


示例8: APP_Initialize

void APP_Initialize ( void ){    //stopEverything();    /* Place the App state machine in its initial state. */    appData.state = APP_STATE_INIT;        /* TODO: Initialize your application's state machine and other     * parameters.     */    //Create the queue    appData.local_q = xQueueCreate(10, sizeof(unsigned int));    //Ensure queue was created. If not, do not continue and turn on LED    if(appData.local_q == 0)    {        stopEverything();    }    appData.sensor1_q = xQueueCreate(100, sizeof(unsigned char));    if(appData.sensor1_q == 0)    {        stopEverything();    }    //stopEverything();    //Create the timer    appData.local_timer = xTimerCreate( "50msTimer",                50 / portTICK_PERIOD_MS,                pdTRUE,                0,                vTimerCallback );        //Ensure timer was created. If not, do not continue and turn on LED    if(appData.local_timer == 0)    {        stopEverything();    }    BaseType_t started = xTimerStart(appData.local_timer, 0);        //Ensure the timer started successfully. If not, do not continue and turn    // on LED    if(started == pdFAIL)    {        stopEverything();    }           //Setup AD Driver    SYS_INT_SourceEnable(INT_SOURCE_ADC_1);    DRV_ADC_Initialize();    DRV_ADC_Open();    DRV_ADC_ChannelScanInputsAdd(ADC_INPUT_SCAN_AN0 | ADC_INPUT_SCAN_AN1|ADC_INPUT_SCAN_AN2);    PLIB_ADC_MuxAInputScanEnable(ADC_ID_1);    DRV_ADC_Start();        /* Initialization is done, allow the state machine to continue */    appData.state = APP_STATE_OUTPUT;}
开发者ID:IceeCitrus,项目名称:Milestone2,代码行数:54,


示例9: timers_init

/**@brief Function for the Timer initialization. * * @details Initializes the timer module. This creates and starts application timers. */static void timers_init(void){    // Initialize timer module.    APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_OP_QUEUE_SIZE, false);    // Create timers.    m_battery_timer        = xTimerCreate("BATT", BATTERY_LEVEL_MEAS_INTERVAL     , pdTRUE, NULL, battery_level_meas_timeout_handler     );    m_heart_rate_timer     = xTimerCreate("HRT" , HEART_RATE_MEAS_INTERVAL        , pdTRUE, NULL, heart_rate_meas_timeout_handler        );    m_rr_interval_timer    = xTimerCreate("RRT" , RR_INTERVAL_INTERVAL            , pdTRUE, NULL, rr_interval_timeout_handler            );    m_sensor_contact_timer = xTimerCreate("SCT" , SENSOR_CONTACT_DETECTED_INTERVAL, pdTRUE, NULL, sensor_contact_detected_timeout_handler);    /* Error checking */    if( (NULL == m_battery_timer)     || (NULL == m_heart_rate_timer)     || (NULL == m_rr_interval_timer)     || (NULL == m_sensor_contact_timer) )    {        APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);    }}
开发者ID:IOIOI,项目名称:nRF51,代码行数:24,


示例10: createTimer

void ICACHE_FLASH_ATTR createTimer(char * ssid, char * pwd){	sprintf(ssid_name, "%s/0", ssid);	sprintf(password,"%s/0",pwd);     xTimerHandle wifiTimer=xTimerCreate("r",200,pdFALSE, (void *)1,vTimerSCallback);       if( xTimerStart( wifiTimer,0) == pdPASS )  {          printf("timer STATION babe!!!!! /n");       }}
开发者ID:JanisIOT,项目名称:JanisEsp8266,代码行数:11,


示例11: timer_initiaize_20

void timer_initiaize_20(int ms){        TimerHandle_t myTimer2;    myTimer2 = xTimerCreate("test2",                           (ms/portTICK_PERIOD_MS),                           pdTRUE,                            (void *)0,                           timerCallback_20);    if (xTimerStart(myTimer2,10) == pdFAIL)        error('a');    } 
开发者ID:skitty1213,项目名称:team3-terrorsofembedded,代码行数:11,


示例12: main

/**  * @brief  Main program  * @param  None  * @retval None  */int main() {    TimerHandle_t idTim1;    idTim1=xTimerCreate("Timer1", 1000/portTICK_RATE_MS, pdTRUE, 0, led1_callback);    xTimerStart(idTim1, 0);    xTaskCreate(led2_thread, "Thread1", 1024, (void*) NULL, tskIDLE_PRIORITY + 1UL, NULL);    vTaskStartScheduler();        for(;;);}
开发者ID:0x00f,项目名称:stm32,代码行数:16,


示例13: queueMonitorInit

void queueMonitorInit() {  ASSERT(!initialized);  timer = xTimerCreate( "queueMonitorTimer", TIMER_PERIOD,    pdTRUE, NULL, timerHandler );  xTimerStart(timer, 100);  data[0].fileName = "Na";  data[0].queueName = "Na";  initialized = true;}
开发者ID:CarlosRDomin,项目名称:crazyflie-firmware,代码行数:11,


示例14: prvInitialise_uIP

static void prvInitialise_uIP( void ){uip_ipaddr_t xIPAddr;xTimerHandle xARPTimer, xPeriodicTimer;	uip_init();	uip_ipaddr( &xIPAddr, configIP_ADDR0, configIP_ADDR1, configIP_ADDR2, configIP_ADDR3 );	uip_sethostaddr( &xIPAddr );	uip_ipaddr( &xIPAddr, configNET_MASK0, configNET_MASK1, configNET_MASK2, configNET_MASK3 );	uip_setnetmask( &xIPAddr );	prvSetMACAddress();	httpd_init();	/* Create the queue used to sent TCP/IP events to the uIP stack. */	xEMACEventQueue = xQueueCreate( uipEVENT_QUEUE_LENGTH, sizeof( unsigned long ) );	/* Create and start the uIP timers. */	xARPTimer = xTimerCreate( 	( signed char * ) "ARPTimer", /* Just a name that is helpful for debugging, not used by the kernel. */								( 10000UL / portTICK_RATE_MS ), /* Timer period. */								pdTRUE, /* Autor-reload. */								( void * ) uipARP_TIMER,								prvUIPTimerCallback							);	xPeriodicTimer = xTimerCreate( 	( signed char * ) "PeriodicTimer",									( 500UL / portTICK_RATE_MS ),									pdTRUE, /* Autor-reload. */									( void * ) uipPERIODIC_TIMER,									prvUIPTimerCallback								);	/* Sanity check that the timers were indeed created. */	configASSERT( xARPTimer );	configASSERT( xPeriodicTimer );	configASSERT( xEMACEventQueue );	/* These commands will block indefinitely until they succeed, so there is	no point in checking their return values. */	xTimerStart( xARPTimer, portMAX_DELAY );	xTimerStart( xPeriodicTimer, portMAX_DELAY );}
开发者ID:ammarkham,项目名称:moos,代码行数:41,


示例15: ad_rf_init

void ad_rf_init(void){        if (dg_configRF_RECALIBRATION_TIMER_TIMEOUT > 0) {                /* Initialize timer */                recalib_timer = xTimerCreate("RFRecalibTimer",                        dg_configRF_RECALIBRATION_TIMER_TIMEOUT,                        pdFALSE,                        NULL,                        recalib_timer_cb);                OS_ASSERT(recalib_timer != NULL);        }}
开发者ID:mikewang01,项目名称:hicling_replant,代码行数:12,


示例16: setup_debug_tools

static void setup_debug_tools(){        /* Only enable this code if we are doing debug work */#if ! (ASL_DEBUG)        return;#endif        const size_t timer_ticks = msToTicks(CHAR_CHECK_PERIOD_MS);        const signed char* timer_name = (signed char*) "Dropped Char Check Timer";        xTimerHandle timer_handle = xTimerCreate(timer_name, timer_ticks,                                                 true, NULL, dropped_char_timer_cb);        xTimerStart(timer_handle, timer_ticks);}
开发者ID:autosportlabs,项目名称:RaceCapture-Pro_firmware,代码行数:12,


示例17: osTimerCreate

/*** @brief  Create a timer.* @param  timer_def     timer object referenced with /ref osTimer.* @param  type          osTimerOnce for one-shot or osTimerPeriodic for periodic behavior.* @param  argument      argument to the timer call back function.* @retval  timer ID for reference by other functions or NULL in case of error.* @note   MUST REMAIN UNCHANGED: /b osTimerCreate shall be consistent in every CMSIS-RTOS.*/osTimerId osTimerCreate (const osTimerDef_t *timer_def, os_timer_type type, void *argument){#if (configUSE_TIMERS == 1)  return xTimerCreate((const char *)"",                      1, // period should be filled when starting the Timer using osTimerStart                      (type == osTimerPeriodic) ? pdTRUE : pdFALSE,                      (void *) argument,                      (TaskFunction_t)timer_def->ptimer);#else 	return NULL;#endif}
开发者ID:Casa2011,项目名称:devices,代码行数:20,


示例18: SEND_Initialize

void SEND_Initialize ( void ){    sendData.state = SEND_STATE_INIT;    sendData.sendCount = 0x55;    sendData.testCount = 0;    sendData.enqueueCount = 0;    sendData.prevType = 'a';    sendData.prevCount = 'a';        strcpy(sendData.storedMessage, "~e8765432.");        sendData.sendStoredMessage = 0;        //Create a queue capable of holding 1000 characters    sendData.transmitQ_SA = xQueueCreate( 1000, sizeof(char) );    if( sendData.transmitQ_SA == 0 ) {        dbgOutputVal(SEND_QUEUE_FAIL);        stopAll();    }        // Create a queue capable of holding 250 messages    sendData.sendQ_LR = xQueueCreate(250, MSG_LENGTH+1);    if (sendData.sendQ_LR == 0) {        dbgOutputVal(SEND_QUEUE_FAIL);        stopAll();    }        //Create a timer    sendData.sendTimer_SA = xTimerCreate(                       "SendTimer100ms", //Just a text name                     ( 1000 / portTICK_PERIOD_MS ), //period is 100ms                     pdTRUE, //auto-reload when expires                     (void *) 24, //a unique id                     sendTimerCallback ); //pointer to callback function            //if SENSOR_DEBUG_NOACK is defined, then don't start the timer    #ifndef SENSOR_DEBUG_NOACK        //Start the timer        if( sendData.sendTimer_SA == NULL ) {            dbgOutputVal(SEND_TIMERINIT_FAIL);            stopAll();        }        else if( xTimerStart( sendData.sendTimer_SA, 0 ) != pdPASS ) {            dbgOutputVal(SEND_TIMERINIT_FAIL);            stopAll();        }    #endif         }
开发者ID:bt2016,项目名称:ece4534_team4,代码行数:52,


示例19: main

void main( void ){	/* Configure the peripherals used by this demo application.  This includes	configuring the joystick input select button to generate interrupts. */	prvSetupHardware();	/* Create the queue used by tasks and interrupts to send strings to the LCD	task. */	xLCDQueue = xQueueCreate( mainQUEUE_LENGTH, sizeof( xQueueMessage ) );	/* If the queue could not be created then don't create any tasks that might	attempt to use the queue. */	if( xLCDQueue != NULL )	{		/* Create the standard demo tasks. */		vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );		vStartDynamicPriorityTasks();		vStartGenericQueueTasks( mainGENERIC_QUEUE_TEST_PRIORITY );		vStartCountingSemaphoreTasks();				/* Note that creating the timer test/demo tasks will fill the timer		command queue.  This is intentional, and forms part of the test the tasks		perform.  It does mean however that, after this function is called, no		more timer commands can be sent until after the scheduler has been		started (at which point the timer daemon will drained the timer command		queue, freeing up space for more commands to be received). */		vStartTimerDemoTask( mainTIMER_TEST_PERIOD );				/* Create the LCD, button poll and register test tasks, as described at		the top	of this	file. */		xTaskCreate( prvLCDTask, ( signed char * ) "LCD", configMINIMAL_STACK_SIZE * 2, mainTASK_PARAMETER_CHECK_VALUE, mainLCD_TASK_PRIORITY, NULL );		xTaskCreate( prvButtonPollTask, ( signed char * ) "BPoll", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );		xTaskCreate( vRegTest1Task, ( signed char * ) "Reg1", configMINIMAL_STACK_SIZE, NULL, 0, NULL );		xTaskCreate( vRegTest2Task, ( signed char * ) "Reg2", configMINIMAL_STACK_SIZE, NULL, 0, NULL );		/* Create the 'check' timer - the timer that periodically calls the		check function as described at the top of this file.  Note that, for		the reasons stated in the comments above the call to 		vStartTimerDemoTask(), that the check timer is not actually started 		until after the scheduler has been started. */		xCheckTimer = xTimerCreate( ( const signed char * ) "Check timer", mainCHECK_TIMER_PERIOD, pdTRUE, ( void * ) 0, vCheckTimerCallback ); 		/* Start the scheduler. */		vTaskStartScheduler();	}	/* If all is well then this line will never be reached.  If it is reached	then it is likely that there was insufficient (FreeRTOS) heap memory space	to create the idle task.  This may have been trapped by the malloc() failed	hook function, if one is configured. */		for( ;; );}
开发者ID:Bjoe,项目名称:msp340x-msp340-5438-stk-ccs,代码行数:52,


示例20: main

int main(void){	int timerID = 1;	int timerID1 = 2;	/*A Timer used to count how long there is no signal come in*/	xTimerNoSignal = xTimerCreate("TurnOffTime", 10000 / portTICK_RATE_MS, pdFALSE,  (void *) timerID, vTimerSystemIdle);	xTimerSampleRate = xTimerCreate("SensorSampleRate", 4 / portTICK_RATE_MS, pdTRUE,  (void *) timerID1, vTimerSample);	/*a queue for tansfer the senddate to USART task*/	xQueueUARTSend = xQueueCreate(15, sizeof(serial_str_msg));   	xQueueUARTRecvie = xQueueCreate(15, sizeof(serial_ch_msg));   	xQueueShell2PWM = xQueueCreate(3, sizeof(pwm_ch_msg));   	xQueuePitchdirection = xQueueCreate(3, sizeof(pitch_direction_msg));   	xQueueRolldirection = xQueueCreate(3, sizeof(roll_direction_msg));	/* initialize hardware... */	prvSetupHardware();	init_I2C1();	xTimerStart(xTimerNoSignal, 0);	/* Start the tasks defined within this file/specific to this demo. */	xTaskCreate(vPWMctrlTask, ( signed portCHAR * ) "pwmctrl", configMINIMAL_STACK_SIZE, NULL,tskIDLE_PRIORITY, NULL );	xTaskCreate(vUsartSendTask, ( signed portCHAR * ) "USART", configMINIMAL_STACK_SIZE, NULL,tskIDLE_PRIORITY, NULL);	xTaskCreate(shell, ( signed portCHAR * ) "shell", configMINIMAL_STACK_SIZE, NULL,tskIDLE_PRIORITY + 5, NULL);	xTaskCreate(vBalanceTask, ( signed portCHAR * ) "Balance", configMINIMAL_STACK_SIZE, NULL,tskIDLE_PRIORITY, NULL);	xTaskCreate(vPitchctrlTask, ( signed portCHAR * ) "Pitchctrl", configMINIMAL_STACK_SIZE, NULL,tskIDLE_PRIORITY, NULL );	xTaskCreate(vRollctrlTask, ( signed portCHAR * ) "Rollctrl", configMINIMAL_STACK_SIZE, NULL,tskIDLE_PRIORITY, NULL );	/* Start the scheduler. */	vTaskStartScheduler();	/* Will only get here if there was not enough heap space to create the idle task. */	return 0;  }
开发者ID:openbox00,项目名称:test,代码行数:39,


示例21: can2Task

/** * @brief	The main task for the CAN2 channel * @param	pvParameters: * @retval	None */void can2Task(void *pvParameters){	/* Mutex semaphore to manage when it's ok to send and receive new data */	xSemaphore = xSemaphoreCreateMutex();	/* Mutex semaphore for accessing the settings for this channel */	xSettingsSemaphore = xSemaphoreCreateMutex();	/* Create software timers */	prvBuffer1ClearTimer = xTimerCreate("Buf1ClearCan2", 10, pdFALSE, 0, prvBuffer1ClearTimerCallback);	prvBuffer2ClearTimer = xTimerCreate("Buf2ClearCan2", 10, pdFALSE, 0, prvBuffer2ClearTimerCallback);	/* Initialize hardware */	prvHardwareInit();	/* Wait to make sure the SPI FLASH is initialized */	while (SPI_FLASH_Initialized() == false)	{		vTaskDelay(100 / portTICK_PERIOD_MS);	}	/* Try to read the settings from SPI FLASH */	prvReadSettingsFromSpiFlash();	can2Clear();	/* The parameter in vTaskDelayUntil is the absolute time	 * in ticks at which you want to be woken calculated as	 * an increment from the time you were last woken. */	TickType_t xNextWakeTime;	/* Initialize xNextWakeTime - this only needs to be done once. */	xNextWakeTime = xTaskGetTickCount();	prvDoneInitializing = true;	while (1)	{		vTaskDelayUntil(&xNextWakeTime, 1000 / portTICK_PERIOD_MS);	}}
开发者ID:hampussandberg,项目名称:HexConnect,代码行数:44,


示例22: createTimerWifi

void ICACHE_FLASH_ATTR createTimerWifi(void){	if(!restartActive){	    restartActive=1;             xTimerHandle wifiTimer2=xTimerCreate("s",200,pdFALSE, (void *)1,vTimerSACallback);           if( xTimerStart( wifiTimer2,0) == pdPASS )  {              printf("timer SOft AP babe!!!!! /n");             }	}}
开发者ID:JanisIOT,项目名称:JanisEsp8266,代码行数:13,


示例23: prvInitialise_uIP

static void prvInitialise_uIP( void ){    TimerHandle_t xARPTimer, xPeriodicTimer;    uip_ipaddr_t xIPAddr;    const unsigned long ul_uIPEventQueueLength = 10UL;    /* Initialise the uIP stack. */    uip_init();    uip_ipaddr( &xIPAddr, configIP_ADDR0, configIP_ADDR1, configIP_ADDR2, configIP_ADDR3 );    uip_sethostaddr( &xIPAddr );    uip_ipaddr( &xIPAddr, configNET_MASK0, configNET_MASK1, configNET_MASK2, configNET_MASK3 );    uip_setnetmask( &xIPAddr );    prvSetMACAddress();    httpd_init();    /* Create the queue used to sent TCP/IP events to the uIP stack. */    xEMACEventQueue = xQueueCreate( ul_uIPEventQueueLength, sizeof( unsigned long ) );    /* Create and start the uIP timers. */    xARPTimer = xTimerCreate( 	"ARPTimer", /* Just a name that is helpful for debugging, not used by the kernel. */                                ( 10000UL / portTICK_PERIOD_MS ), /* Timer period. */                                pdTRUE, /* Autor-reload. */                                ( void * ) uipARP_TIMER,                                prvUIPTimerCallback                            );    xPeriodicTimer = xTimerCreate( 	"PeriodicTimer",                                    ( 50 / portTICK_PERIOD_MS ),                                    pdTRUE, /* Autor-reload. */                                    ( void * ) uipPERIODIC_TIMER,                                    prvUIPTimerCallback                                 );    configASSERT( xARPTimer );    configASSERT( xPeriodicTimer );    xTimerStart( xARPTimer, portMAX_DELAY );    xTimerStart( xPeriodicTimer, portMAX_DELAY );}
开发者ID:BuiChien,项目名称:FreeRTOS-TM4C123GXL,代码行数:39,


示例24: startTimerForADC

void startTimerForADC(adcStruct *adcData) {	if (sizeof(long) != sizeof(adcStruct *)) {		VT_HANDLE_FATAL_ERROR(0);	}	xTimerHandle adcTimerHandle = xTimerCreate((const signed char *)"ADC Timer",adcWRITE_RATE_BASE,pdTRUE,(void *) adcData,adcTimerCallback);	if (adcTimerHandle == NULL) {		VT_HANDLE_FATAL_ERROR(0);	} else {		if (xTimerStart(adcTimerHandle,0) != pdPASS) {			VT_HANDLE_FATAL_ERROR(0);		}	}}
开发者ID:nbjones,项目名称:RTOSDemo,代码行数:13,


示例25: startTimerForLCD

void startTimerForLCD(vtLCDStruct *vtLCDdata) {	if (sizeof(long) != sizeof(vtLCDStruct *)) {		VT_HANDLE_FATAL_ERROR(0);	}	xTimerHandle LCDTimerHandle = xTimerCreate((const signed char *)"LCD Timer",lcdWRITE_RATE_BASE,pdTRUE,(void *) vtLCDdata,LCDTimerCallback);	if (LCDTimerHandle == NULL) {		VT_HANDLE_FATAL_ERROR(0);	} else {		if (xTimerStart(LCDTimerHandle,0) != pdPASS) {			VT_HANDLE_FATAL_ERROR(0);		}	}}
开发者ID:nbjones,项目名称:RTOSDemo,代码行数:13,


示例26: rttmr_create

/*-------------------------------------------| Name:rttmr_create| Description:| Parameters:| Return Type:| Comments:| See:---------------------------------------------*/int rttmr_create(tmr_t* tmr,rttmr_attr_t* rttmr_attr){   if(!tmr || !rttmr_attr)      return -1;#ifdef __KERNEL_UCORE_FREERTOS   //OS_CreateTimer(tmr,rttmr_attr->func,rttmr_attr->tm_msec);   xTimerCreate( "timer",                (portTickType)(rttmr_attr->tm_msec/portTICK_RATE_MS),                pdFALSE,                tmr,                (tmrTIMER_CALLBACK) rttmr_attr->func );#endif   return 0;}
开发者ID:lepton-distribution,项目名称:lepton,代码行数:21,



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


C++ xTimerStart函数代码示例
C++ xTaskIncrementTick函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。