这篇教程C++ xTimerStart函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中xTimerStart函数的典型用法代码示例。如果您正苦于以下问题:C++ xTimerStart函数的具体用法?C++ xTimerStart怎么用?C++ xTimerStart使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了xTimerStart函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: main_fullvoid main_full( void ){TimerHandle_t 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, "Reg1", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL ); xTaskCreate( vRegTest2Task, "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( "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( ;; ); }
开发者ID:vstehle,项目名称:FreeRTOS,代码行数:52,
示例2: SEND_Initializevoid 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,
示例3: soundInitvoid soundInit(void){ if (isInit) return; neffect = sizeof(effects)/sizeof(effects[0])-1; timer = xTimerCreate("SoundTimer", M2T(10), pdTRUE, NULL, soundTimer); xTimerStart(timer, 100); isInit = true;}
开发者ID:Alfredvc,项目名称:crazyflie,代码行数:13,
示例4: createTimerWifivoid 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,
示例5: startTimerForADCvoid 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,
示例6: startTimerForLCDvoid 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,
示例7: prvInitialise_uIPstatic 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,
示例8: app_timer_startuint32_t app_timer_start(app_timer_id_t timer_id, uint32_t timeout_ticks, void * p_context){ app_timer_info_t * pinfo = (app_timer_info_t*)(timer_id); TimerHandle_t hTimer = pinfo->osHandle; uint32_t rtc_prescaler = portNRF_RTC_REG->PRESCALER + 1; /* Get back the microseconds to wait */ uint32_t timeout_corrected = ROUNDED_DIV(timeout_ticks * m_prescaler, rtc_prescaler); if (hTimer == NULL) { return NRF_ERROR_INVALID_STATE; } if (pinfo->active && (xTimerIsTimerActive(hTimer) != pdFALSE)) { // Timer already running - exit silently return NRF_SUCCESS; } pinfo->argument = p_context; if (__get_IPSR() != 0) { BaseType_t yieldReq = pdFALSE; if (xTimerChangePeriodFromISR(hTimer, timeout_corrected, &yieldReq) != pdPASS) { return NRF_ERROR_NO_MEM; } if ( xTimerStartFromISR(hTimer, &yieldReq) != pdPASS ) { return NRF_ERROR_NO_MEM; } portYIELD_FROM_ISR(yieldReq); } else { if (xTimerChangePeriod(hTimer, timeout_corrected, APP_TIMER_WAIT_FOR_QUEUE) != pdPASS) { return NRF_ERROR_NO_MEM; } if (xTimerStart(hTimer, APP_TIMER_WAIT_FOR_QUEUE) != pdPASS) { return NRF_ERROR_NO_MEM; } } pinfo->active = true; return NRF_SUCCESS;}
开发者ID:AaltoNEPPI,项目名称:nRF52_dev,代码行数:51,
示例9: startProductionControlvoid startProductionControl(){ // Initialize xpre and xhat int i; for(i = 0; i < 4; ++i){ plantParams.xpre[i] = 0.; // precomputed state vector plantParams.xhat[i] = 0.; // state vector [theta, alpha, thetadot, alphadot] } plantParams.cycle_count = 0; // Make sure tick_count is set to 1000 so that each tick is 1 millisecond as seen bellow ProductionControlTimer = xTimerCreate((const signed char *)"Production Controller Timer",1,pdTRUE,(void *) NULL, production_control_timer); xTimerStart(ProductionControlTimer, 0); xil_printf("Production Controller Timer started/n");}
开发者ID:pallavides,项目名称:Bare_AMP_Zed,代码行数:14,
示例10: wiced_rtos_start_timerwiced_result_t wiced_rtos_start_timer( wiced_timer_t* timer ){ if ( xTimerReset( timer->handle, WICED_WAIT_FOREVER ) != pdPASS ) { return WICED_ERROR; } if ( xTimerStart( timer->handle, WICED_WAIT_FOREVER ) != pdPASS ) { return WICED_ERROR; } return WICED_SUCCESS;}
开发者ID:fishbaoz,项目名称:wiced-emw3165,代码行数:14,
示例11: APP_Initializevoid APP_Initialize ( void ){ /* Place the App state machine in its initial state. */ appData.state = APP_STATE_INIT; /* TODO: Initialize your application's state machine and other * parameters. */ // uart initialization // The following code snippet shows an example USART driver initialization. // The driver is initialized for normal mode and a baud of 300. The // receive queue size is set to 2 and transmit queue size is set to 3. usartInit.baud = 57600; usartInit.mode = DRV_USART_OPERATION_MODE_NORMAL; usartInit.flags = DRV_USART_INIT_FLAG_NONE; usartInit.usartID = USART_ID_1; usartInit.brgClock = 80000000; usartInit.handshake = DRV_USART_HANDSHAKE_NONE; usartInit.lineControl = DRV_USART_LINE_CONTROL_8NONE1; usartInit.interruptError = INT_SOURCE_USART_1_ERROR; usartInit.interruptReceive = INT_SOURCE_USART_1_RECEIVE; usartInit.queueSizeReceive = 2; usartInit.queueSizeTransmit = 3; usartInit.interruptTransmit = INT_SOURCE_USART_1_TRANSMIT; usartInit.moduleInit.value = SYS_MODULE_POWER_RUN_FULL;// objectHandle = DRV_USART_Initialize(DRV_USART_INDEX_1, (SYS_MODULE_INIT*)&usartInit);// if (SYS_MODULE_OBJ_INVALID == objectHandle)// {// // Handle error// } handle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_NONBLOCKING | DRV_IO_INTENT_WRITE); if (DRV_HANDLE_INVALID == handle) { // Unable to open the driver // May be the driver is not initialized or the initialization // is not complete. } // timer setup xTimer = xTimerCreate("Timer", 10, pdTRUE, 0, vTimerCallback); xTimerStart(xTimer, 0); vTaskStartScheduler();}
开发者ID:ryandw12,项目名称:Milestone2,代码行数:50,
示例12: lineTimerCallbackvoid lineTimerCallback( TimerHandle_t pxTimer ){ outputEvent(LINE_READING_START); if(!wait) if( xTimerStart( lineTimer, 0 ) != pdPASS ) outputEvent(LINETIMER_NOT_STARTED); //Set Pins to digital output and HIGH SYS_PORTS_PinDirectionSelect(PORTS_ID_0, SYS_PORTS_DIRECTION_OUTPUT, PORT_CHANNEL_B, PORTS_BIT_POS_11); SYS_PORTS_PinDirectionSelect(PORTS_ID_0, SYS_PORTS_DIRECTION_OUTPUT, PORT_CHANNEL_B, PORTS_BIT_POS_12); SYS_PORTS_PinDirectionSelect(PORTS_ID_0, SYS_PORTS_DIRECTION_OUTPUT, PORT_CHANNEL_B, PORTS_BIT_POS_13); SYS_PORTS_PinDirectionSelect(PORTS_ID_0, SYS_PORTS_DIRECTION_OUTPUT, PORT_CHANNEL_G, PORTS_BIT_POS_8); SYS_PORTS_PinDirectionSelect(PORTS_ID_0, SYS_PORTS_DIRECTION_OUTPUT, PORT_CHANNEL_A, PORTS_BIT_POS_10); SYS_PORTS_PinDirectionSelect(PORTS_ID_0, SYS_PORTS_DIRECTION_OUTPUT, PORT_CHANNEL_F, PORTS_BIT_POS_0); SYS_PORTS_PinDirectionSelect(PORTS_ID_0, SYS_PORTS_DIRECTION_OUTPUT, PORT_CHANNEL_F, PORTS_BIT_POS_1); SYS_PORTS_PinDirectionSelect(PORTS_ID_0, SYS_PORTS_DIRECTION_OUTPUT, PORT_CHANNEL_D, PORTS_BIT_POS_6); SYS_PORTS_PinSet(PORTS_ID_0, PORT_CHANNEL_B, PORTS_BIT_POS_11); SYS_PORTS_PinSet(PORTS_ID_0, PORT_CHANNEL_B, PORTS_BIT_POS_13); SYS_PORTS_PinSet(PORTS_ID_0, PORT_CHANNEL_B, PORTS_BIT_POS_12); SYS_PORTS_PinSet(PORTS_ID_0, PORT_CHANNEL_G, PORTS_BIT_POS_8); SYS_PORTS_PinSet(PORTS_ID_0, PORT_CHANNEL_A, PORTS_BIT_POS_10); SYS_PORTS_PinSet(PORTS_ID_0, PORT_CHANNEL_F, PORTS_BIT_POS_0); SYS_PORTS_PinSet(PORTS_ID_0, PORT_CHANNEL_F, PORTS_BIT_POS_1); SYS_PORTS_PinSet(PORTS_ID_0, PORT_CHANNEL_D, PORTS_BIT_POS_6); //Start timer to charge cap and read data validData = false; if( xTimerStart( readTimer, 0 ) != pdPASS ){ outputEvent(READTIMER_NOT_STARTED); }}
开发者ID:kyleimh,项目名称:Embedded,代码行数:36,
示例13: mainint main(void) { initx(); xTimerHandle timer = xTimerCreate((const signed char *) "timer", 1000 / portTICK_RATE_MS, pdTRUE, NULL, toggleLedCallback); send_string_uart("timer created/n"); queue = xQueueCreate(20, 1); xTaskCreate(acceleration_task, (signed char*)"acceleration_task", 128, NULL, tskIDLE_PRIORITY+1, NULL); send_string_uart("queue created/n"); xTimerStart(timer, 0); send_string_uart("timer started/n"); send_string_uart("INIT DONE, Starting/n"); vTaskStartScheduler(); return 0;}
开发者ID:nraynaud,项目名称:DiscoveryF4_RTOS,代码行数:15,
示例14: vModeAstroStartvoid vModeAstroStart(uint8_t motor_mask, uint8_t dir, float_t gear, float_t fact){ if (state != MODE_ASTRO_STATE_STOP) return; taskENTER_CRITICAL(); { state = MODE_ASTRO_STATE_WAKE_SM; motors = motor_mask; direction = dir; gear_reduction = gear; factor = fact; xTimerStart(xModeAstroControlTimer, 0); } taskEXIT_CRITICAL();}
开发者ID:milindur,项目名称:MdkController,代码行数:15,
示例15: main_blinkyvoid main_blinky( void ){xTimerHandle xTimer;xQueueHandle xQueue; /* Create the queue. */ xQueue = xQueueCreate( mainQUEUE_LENGTH, sizeof( unsigned long ) ); if( xQueue != NULL ) { /* Start the two tasks as described in the comments at the top of this file. */ xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */ ( signed char * ) "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */ configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */ ( void * ) xQueue, /* Pass the queue into the task using the task parameter. */ mainQUEUE_RECEIVE_TASK_PRIORITY, /* The priority assigned to the task. */ NULL ); /* The task handle is not required, so NULL is passed. */ xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, ( void * ) xQueue, mainQUEUE_SEND_TASK_PRIORITY, NULL ); /* Create the blinky software timer as described at the top of this file. */ xTimer = xTimerCreate( ( const signed char * ) "Blinky",/* A text name, purely to help debugging. */ ( mainBLINKY_TIMER_PERIOD ), /* The timer period. */ 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. */ prvBlinkyTimerCallback ); /* The callback function that inspects the status of all the other tasks. */ configASSERT( xTimer ); if( xTimer != NULL ) { xTimerStart( xTimer, mainDONT_BLOCK ); } /* Start the tasks and timer running. */ 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( ;; );}
开发者ID:BirdBare,项目名称:STM32F4-Discovery_FW_V1.1.0_Makefiles,代码行数:47,
示例16: vFullDemoIdleHookvoid vFullDemoIdleHook( void ){static TimerHandle_t xCheckTimer = NULL; if( xCheckTimer == NULL ) { /* Create the software timer that performs the 'check' functionality, in the full demo. This is not done before the scheduler is started as to do so would prevent the standard demo timer tasks from passing their tests (they expect the timer command queue to be empty. */ xCheckTimer = xTimerCreate( "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 ); } /* Also start some timers that just flash LEDs. */ vStartLEDFlashTimers( mainNUM_FLASH_TIMER_LEDS ); } /* If the file system is only going to be accessed from one task then F_FS_THREAD_AWARE can be set to 0 and the set of example files is created before the RTOS scheduler is started. If the file system is going to be access from more than one task then F_FS_THREAD_AWARE must be set to 1 and the set of sample files are created from the idle task hook function. */ #if( F_FS_THREAD_AWARE == 1 ) { static portBASE_TYPE xCreatedSampleFiles = pdFALSE; /* Initialise the drive and file system, then create a few example files. The output from this function just goes to the stdout window, allowing the output to be viewed when the UDP command console is not connected. */ if( xCreatedSampleFiles == pdFALSE ) { vCreateAndVerifySampleFiles(); xCreatedSampleFiles = pdTRUE; } } #endif}
开发者ID:BuiChien,项目名称:FreeRTOS-TM4C123GXL,代码行数:47,
示例17: mainextern "C" int main(void){#if !defined(ARDUINO) // To use Teensy 3.0 without Arduino, simply put your code here. // For example: pinMode(13, OUTPUT); serial.begin(9600); while (1) { digitalWriteFast(13, HIGH); delay(500); digitalWriteFast(13, LOW); delay(500); }#else#ifdef TEENSY_FREERTOS pinMode(13, OUTPUT); pinMode(12, OUTPUT); xTaskCreate( prvQueueReceiveTask, "Rx", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL ); xTaskCreate( UARTLogTask, "ULog", configMINIMAL_STACK_SIZE, NULL, UARTLog_Task_Priority, NULL ); xLEDTimer = xTimerCreate( "LEDTimer", /* A text name, purely to help debugging. */ ( mainLED_TIMER_PERIOD_MS ), /* The timer period, in this case 5000ms (5s). */ pdTRUE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */ ( void * ) 0, /* The ID is not used, so can be set to anything. */ prvLEDTimerCallback /* The callback function that switches the LED off. */ ); xTimerStart( xLEDTimer, mainDONT_BLOCK ); vTaskStartScheduler();#else // Arduino's main() function just calls setup() and loop().... setup(); while (1) { loop(); yield(); }#endif /* TEENSY_FREERTOS */#endif}
开发者ID:lowfatcomputing,项目名称:Teensy-3.1-FreeRTOS,代码行数:46,
示例18: ringbuf_flushvoidIIS328DQ::start(){ /* make sure we are stopped first */ //stop(); /* reset the report ring */ ringbuf_flush(_reports); /* start polling at the specified rate */ int ticks = USEC2TICK(_call_interval); if(ticks == 0) ticks = 1;//定时器时间间隔不可为0 /* reset the report ring and state machine */ _call = xTimerCreate("accel timer", USEC2TICK(_call_interval), pdTRUE, this, &IIS328DQ::measure_trampoline); xTimerStart(_call, portMAX_DELAY);}
开发者ID:SovietUnion1997,项目名称:PhenixPro_Devkit,代码行数:17,
示例19: MQTT_Connect/** * @brief Begin connect to MQTT broker * @param client: MQTT_Client reference * @retval None */void ICACHE_FLASH_ATTRMQTT_Connect(MQTT_Client *mqttClient){ if (mqttClient->pCon) { // Clean up the old connection forcefully - using MQTT_Disconnect // does not actually release the old connection until the // disconnection callback is invoked. mqtt_tcpclient_delete(mqttClient); } mqttClient->pCon = (struct espconn *)calloc(1, sizeof(struct espconn)); mqttClient->pCon->type = ESPCONN_TCP; mqttClient->pCon->state = ESPCONN_NONE; mqttClient->pCon->proto.tcp = (esp_tcp *)calloc(1, sizeof(esp_tcp)); mqttClient->pCon->proto.tcp->local_port = espconn_port(); mqttClient->pCon->proto.tcp->remote_port = mqttClient->port; mqttClient->pCon->reserve = mqttClient; espconn_regist_connectcb(mqttClient->pCon, mqtt_tcpclient_connect_cb); espconn_regist_reconcb(mqttClient->pCon, mqtt_tcpclient_recon_cb); mqttClient->keepAliveTick = 0; mqttClient->reconnectTick = 0; xTimerReset(mqttClient->mqttTimer, portMAX_DELAY); xTimerStart(mqttClient->mqttTimer, portMAX_DELAY); if (UTILS_StrToIP(mqttClient->host, &mqttClient->pCon->proto.tcp->remote_ip)) { INFO("TCP: Connect to ip %s:%d/r/n", mqttClient->host, mqttClient->port); if (mqttClient->security) {#ifdef MQTT_SSL_ENABLE espconn_secure_connect(mqttClient->pCon);#else INFO("TCP: Do not support SSL/r/n");#endif } else { espconn_connect(mqttClient->pCon); } } else { INFO("TCP: Connect to domain %s:%d/r/n", mqttClient->host, mqttClient->port); espconn_gethostbyname(mqttClient->pCon, mqttClient->host, &mqttClient->ip, mqtt_dns_found); } mqttClient->connState = TCP_CONNECTING;}
开发者ID:resetnow,项目名称:esp_mqtt,代码行数:51,
示例20: vModeSmsStartExposeNowvoid vModeSmsStartExposeNow(void){ if (state != MODE_SMS_STATE_STOP) return; taskENTER_CRITICAL(); { test_mode = mode_smsTEST_EXPOSE_NOW; current_step = 0; current_loop = 0; step_timer = 0; interval_timer = 0; state = MODE_SMS_STATE_WAIT_PRE_TIME; xTimerStart(xModeSmsControlTimer, 0); } taskEXIT_CRITICAL();}
开发者ID:milindur,项目名称:MdkController,代码行数:18,
示例21: task_starttimervoid task_starttimer(void* p){ TimerHandle_t t = xTimerCreate("Toggle LED timer", pdMS_TO_TICKS(500), pdTRUE, NULL, ToggleLEDTimer); if (t == NULL) { ESP_LOGE(tag, "Unable to create timer"); } else { ESP_LOGI(tag, "Timer created"); xTimerStart(t, 1); } while (1) { vTaskDelay(pdMS_TO_TICKS(20000)); }}
开发者ID:Scalpel78,项目名称:Ghost,代码行数:18,
示例22: mainint main( void ){ prvInitializeExceptions(); /* Create Binary Semaphore */ vSemaphoreCreateBinary(xSemaphore_led); configASSERT( xSemaphore_led ); /* Setup the GPIO Hardware. */ prvSetGpioHardware(); /* Create the task */ xTaskCreate( prvLed_Task, ( signed char * ) "LED_TASK", configMINIMAL_STACK_SIZE, NULL, mainLED_TASK_PRIORITY, &xTask ); /* Create timer. Starting the timer before the scheduler has been started means the timer will start running immediately that the scheduler starts. */ xTimer = xTimerCreate ( (const signed char *) "LedTimer", TIMER_PERIOD, pdTRUE, /* auto-reload when expires */ (void *) TIMER_ID, /* unique id */ vTimerCallback /* Callback */ ); if ( xTimer == NULL ) { /* The timer was not created. */ xil_printf("Failed to create timer/n/r"); prvShutdown(); return 0; } else { /* Start the timer */ xTimerStart( xTimer, 0 ); } /* Starting the scheduler will start the timers running as it is already been set into the active state. */ vTaskStartScheduler(); /* Should not reach here. */ for( ;; );}
开发者ID:tejachil,项目名称:Zedboard-Pendulum-Control,代码行数:44,
示例23: sw_timers_initvoid sw_timers_init(void){ //for(u8 i=0; i<2; i++) //{ xTimers[0] = xTimerCreate ( /* Just a text name, not used by the RTOS kernel. */ "Timer", /* The timer period in ticks. */ ( 250 * 1 ), /* The timers will auto-reload themselves when they expire. */ pdTRUE, /* Assign each timer a unique id equal to its array index. */ ( void * ) 0, /* Each timer calls the same callback when it expires. */ vTimerCallback ); //} xTimers[1] = xTimerCreate ( /* Just a text name, not used by the RTOS kernel. */ "Timer", /* The timer period in ticks. */ ( 250 * 2 ), /* The timers will auto-reload themselves when they expire. */ pdTRUE, /* Assign each timer a unique id equal to its array index. */ ( void * ) 1, /* Each timer calls the same callback when it expires. */ vTimerCallback );#if 0 if( xTimers != NULL ) { if( xTimerStart( xTimers, 0 ) != pdPASS ) { /* The timer could not be set into the Active state. */ } }#endif}
开发者ID:evchar,项目名称:charging,代码行数:44,
示例24: main/** * /brief Main code entry point. */int main( void ){ xTimerHandle xMonitorTimer; /* Prepare the hardware */ prvSetupHardware(); /* Init Prime Stack */ vPrimeStackInitTask(); /* Configure console */ configure_dbg_console(); puts(STRING_HEADER); /* Debug port for AppEmu */ if (!pio_get(PIN_APPEMU_PIO, PIN_APPEMU_TYPE, PIN_APPEMU_MASK)) { /* Init AppEmu Application */ vAppEmuInitTask(); } /* Create timer to monitor tasks execution */ xMonitorTimer = xTimerCreate( (const signed char *const)"Monitor timer", SIGNALLING_TIMER_RATE, pdTRUE, NULL, _prime_signalling ); configASSERT(xMonitorTimer); xTimerStart(xMonitorTimer, SIGNALLING_TIMER_RATE); /* Start the tasks and timer running. */ 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 (;;) { }}
开发者ID:ThucVD2704,项目名称:femto-usb-blink-example,代码行数:46,
示例25: rpmsg_read_cbstatic void rpmsg_read_cb(struct rpmsg_channel *rp_chnl, void *data, int len, void * priv, unsigned long src) { if ((*(int *) data) == SHUTDOWN_MSG) { remoteproc_resource_deinit(proc);#ifdef USE_FREERTOS int TempTimerId; stop_scheduler = xTimerCreate("TMR", DELAY_200MSEC, pdFALSE, (void *)&TempTimerId, StopSchedulerTmrCallBack); xTimerStart(stop_scheduler, 0);#endif }else{ recv_mat_data.data = data; recv_mat_data.length = len;#ifdef USE_FREERTOS xQueueSend(mat_mul_queue , &recv_mat_data, portMAX_DELAY );#else pq_enqueue(mat_mul_queue, &recv_mat_data);#endif }}
开发者ID:curtisembedded,项目名称:embeddedsw,代码行数:19,
注:本文中的xTimerStart函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ xWrite8函数代码示例 C++ xTimerCreate函数代码示例 |