这篇教程C++ xPortGetFreeHeapSize函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中xPortGetFreeHeapSize函数的典型用法代码示例。如果您正苦于以下问题:C++ xPortGetFreeHeapSize函数的具体用法?C++ xPortGetFreeHeapSize怎么用?C++ xPortGetFreeHeapSize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了xPortGetFreeHeapSize函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: vApplicationIdleHookvoid vApplicationIdleHook( void ){volatile size_t xFreeStackSpace; /* This function is called on each cycle of the idle task. In this case it does nothing useful, other than report the amount of FreeRTOS heap that remains unallocated. */ xFreeStackSpace = xPortGetFreeHeapSize(); if( xFreeStackSpace > 100 ) { /* By now, the kernel has allocated everything it is going to, so if there is a lot of heap remaining unallocated then the value of configTOTAL_HEAP_SIZE in FreeRTOSConfig.h can be reduced accordingly. */ }}
开发者ID:vmandrews,项目名称:CSDC-OBC-Software,代码行数:17,
示例2: user_initvoid user_init(void) { lastTick = xTaskGetTickCount(); startMem = lastMem = xPortGetFreeHeapSize(); sdk_uart_div_modify(0, UART_CLK_FREQ / 115200); setbuf(stdin, NULL); setbuf(stdout, NULL); // this doesn't have enough stack! //lispTask(NULL); return; // for now run in a task, in order to allocate a bigger stack // 1024 --> (fibo 13) // 2048 --> (fibo 30) ??? xTaskCreate(lispTask, (signed char *)"lispTask", 2048, NULL, 2, NULL);}
开发者ID:f0086,项目名称:esp-lisp,代码行数:17,
示例3: vApplicationIdleHookvoid vApplicationIdleHook( void ){volatile size_t xFreeHeapSpace, xMinimumEverFreeHeapSpace; /* This is just a trivial example of an idle hook. It is called on each cycle of the idle task. It must *NOT* attempt to block. In this case the idle task just queries the amount of FreeRTOS heap that remains. See the memory management section on the http://www.FreeRTOS.org web site for memory management options. If there is a lot of heap memory free then the configTOTAL_HEAP_SIZE value in FreeRTOSConfig.h can be reduced to free up RAM. */ xFreeHeapSpace = xPortGetFreeHeapSize(); xMinimumEverFreeHeapSpace = xPortGetMinimumEverFreeHeapSize(); /* Remove compiler warning about xFreeHeapSpace being set but never used. */ ( void ) xFreeHeapSpace; ( void ) xMinimumEverFreeHeapSpace;}
开发者ID:Eclo,项目名称:FreeRTOS,代码行数:18,
示例4: vApplicationIdleHookvoid vApplicationIdleHook( void ){volatile size_t xFreeHeapSpace; /* This is just a trivial example of an idle hook. It is called on each cycle of the idle task. It must *NOT* attempt to block. In this case the idle task just queries the amount of FreeRTOS heap that remains. See the memory management section on the http://www.FreeRTOS.org web site for memory management options. If there is a lot of heap memory free then the configTOTAL_HEAP_SIZE value in FreeRTOSConfig.h can be reduced to free up RAM. */ xFreeHeapSpace = xPortGetFreeHeapSize(); /* Remove compiler warning about xFreeHeapSpace being set but never used. */ ( void ) xFreeHeapSpace; #if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY != 1 { /* 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 } #endif}
开发者ID:BuiChien,项目名称:FreeRTOS-TM4C123GXL,代码行数:42,
示例5: get_task_statestatic int get_task_state(int argc, char **argv){ TaskStatus_t *pxTaskStatusArray; volatile UBaseType_t uxArraySize, x; uint32_t ulTotalRunTime, ulStatsAsPercentage; uxArraySize = uxTaskGetNumberOfTasks(); pxTaskStatusArray = pvPortMalloc( uxArraySize * sizeof( TaskStatus_t ) ); if( pxTaskStatusArray != NULL ) { printf("任务名/t/tID/t优先级/t堆栈/tCPU使用率/r/n"); uxArraySize = uxTaskGetSystemState( pxTaskStatusArray, uxArraySize, &ulTotalRunTime ); if( ulTotalRunTime > 0 ) { for( x = 0; x < uxArraySize; x++ ) { ulStatsAsPercentage = pxTaskStatusArray[ x ].ulRunTimeCounter / ulTotalRunTime * 100; if( ulStatsAsPercentage > 0UL ) { printf("%-16s%-8d%-8d%-8d%d%%/r/n", pxTaskStatusArray[x].pcTaskName,pxTaskStatusArray[x].xTaskNumber, pxTaskStatusArray[x].uxCurrentPriority, pxTaskStatusArray[x].usStackHighWaterMark, ulStatsAsPercentage); vTaskDelay(100/portTICK_RATE_MS); } else { printf("%-16s%-8d%-8d%-8d<1%%/r/n", pxTaskStatusArray[x].pcTaskName,pxTaskStatusArray[x].xTaskNumber, pxTaskStatusArray[x].uxCurrentPriority, pxTaskStatusArray[x].usStackHighWaterMark); vTaskDelay(100/portTICK_RATE_MS); } } } vPortFree( pxTaskStatusArray ); } printf("/r/n"); size_t freeHeapSize = xPortGetFreeHeapSize(); printf("the free heapsize is %d/r/n", freeHeapSize); vTaskDelay(50/portTICK_RATE_MS); return 0;}
开发者ID:yangk,项目名称:FreeRTOS_BOARD_DEMO,代码行数:41,
示例6: getStationICACHE_FLASH_ATTR struct shoutcast_info* getStation(uint8_t position) { if (position > NBSTATIONS-1) {printf("getStation fails position=%d/n",position); return NULL;} uint8_t* buffer = malloc(256); while (buffer== NULL) { buffer = malloc(256); if ( buffer == NULL ){ int i = 0; do { i++; printf ("Heap size: %d/n",xPortGetFreeHeapSize( )); vTaskDelay(10); printf("getstation malloc fails for %d/n",256 ); } while (i<10); if (i >=10) { /*free(string);*/ return NULL;} } } eeGetData((position+1)*256, buffer, 256); return (struct shoutcast_info*)buffer;}
开发者ID:jlaica,项目名称:ESP8266-WebRadio,代码行数:21,
示例7: updateStats/** * Called periodically to update the system stats */static void updateStats(){ static portTickType lastTickCount = 0; SystemStatsData stats; // Get stats and update SystemStatsGet(&stats); stats.FlightTime = xTaskGetTickCount() * portTICK_RATE_MS;#if defined(ARCH_POSIX) || defined(ARCH_WIN32) // POSIX port of FreeRTOS doesn't have xPortGetFreeHeapSize() stats.HeapRemaining = 10240;#else stats.HeapRemaining = xPortGetFreeHeapSize();#endif // Get Irq stack status stats.IRQStackRemaining = GetFreeIrqStackSize(); // When idleCounterClear was not reset by the idle-task, it means the idle-task did not run if (idleCounterClear) { idleCounter = 0; } portTickType now = xTaskGetTickCount(); if (now > lastTickCount) { uint32_t dT = (xTaskGetTickCount() - lastTickCount) * portTICK_RATE_MS; // in ms stats.CPULoad = 100 - (uint8_t) round(100.0 * ((float)idleCounter / ((float)dT / 1000.0)) / (float)IDLE_COUNTS_PER_SEC_AT_NO_LOAD); } //else: TickCount has wrapped, do not calc now lastTickCount = now; idleCounterClear = 1; #if defined(PIOS_INCLUDE_ADC) && defined(PIOS_ADC_USE_TEMP_SENSOR) float temp_voltage = 3.3 * PIOS_ADC_PinGet(0) / ((1 << 12) - 1); const float STM32_TEMP_V25 = 1.43; /* V */ const float STM32_TEMP_AVG_SLOPE = 4.3; /* mV/C */ stats.CPUTemp = (temp_voltage-STM32_TEMP_V25) * 1000 / STM32_TEMP_AVG_SLOPE + 25;#endif SystemStatsSet(&stats);}
开发者ID:abdulparis1,项目名称:OpenPilot,代码行数:43,
示例8: serial_taskstatic void serial_task(void *handle){ int i; (void) handle; portCHAR data; vTasksRunning = TRUE; i = 0; for (;;) { debug_printf("%04i: Hello Task! (%04i bytes free heap memory)/n", i++, xPortGetFreeHeapSize()); GPIOSetValue(LED_PORT, LED_BIT, LED_ON); vTaskDelay(10 / portTICK_RATE_MS); GPIOSetValue(LED_PORT, LED_BIT, LED_OFF); while (vUSBRecvByte(&data, sizeof(data), 990)) UARTSendChar(data); }}
开发者ID:code-constructor,项目名称:openbeacon,代码行数:22,
示例9: machine_infoSTATIC mp_obj_t machine_info(uint n_args, const mp_obj_t *args) { // FreeRTOS info { printf("---------------------------------------------/n"); printf("FreeRTOS/n"); printf("---------------------------------------------/n"); printf("Total heap: %u/n", configTOTAL_HEAP_SIZE); printf("Free heap: %u/n", xPortGetFreeHeapSize()); printf("MpTask min free stack: %u/n", (unsigned int)uxTaskGetStackHighWaterMark((TaskHandle_t)mpTaskHandle)); printf("ServersTask min free stack: %u/n", (unsigned int)uxTaskGetStackHighWaterMark((TaskHandle_t)svTaskHandle)); printf("SlTask min free stack: %u/n", (unsigned int)uxTaskGetStackHighWaterMark(xSimpleLinkSpawnTaskHndl)); printf("IdleTask min free stack: %u/n", (unsigned int)uxTaskGetStackHighWaterMark(xTaskGetIdleTaskHandle())); uint32_t *pstack = (uint32_t *)&_stack; while (*pstack == 0x55555555) { pstack++; } printf("MAIN min free stack: %u/n", pstack - ((uint32_t *)&_stack)); printf("---------------------------------------------/n"); } return mp_const_none;}
开发者ID:worker-bee-micah,项目名称:micropython,代码行数:23,
示例10: mainint main(int argc, char* argv[]){ // At this stage the system clock should have already been configured // at high speed.#if !USE_WRAPPER xTaskCreate(task_led4, (const char * ) "Led4", configMINIMAL_STACK_SIZE, NULL, TASK_LED4_PRIO, NULL); xTaskCreate(task_led3, (const char * ) "Led3", configMINIMAL_STACK_SIZE, NULL, TASK_LED3_PRIO, &handle_led3);#else static TSK_T1 tsk_t1; static TSK_T2 tsk_t2; tsk_t1.link(tsk_t2);#endif volatile size_t size = xPortGetFreeHeapSize(); vTaskStartScheduler(); // should never return}
开发者ID:boutboutnico,项目名称:femtin,代码行数:24,
示例11: prvLCDTaskstatic void prvLCDTask( void *pvParameters ){ xQueueMessage xReceivedMessage; long lLine = Line1; const long lFontHeight = (((sFONT *)LCD_GetFont())->Height); /* Buffer into which strings are formatted and placed ready for display on the LCD. Note this is a static variable to prevent it being allocated on the task stack, which is too small to hold such a variable. The stack size is configured when the task is created. */ static char cBuffer[ 512 ]; /* This function is the only function that uses printf(). If printf() is used from any other function then some sort of mutual exclusion on stdout will be necessary. This is also the only function that is permitted to access the LCD. First print out the number of bytes that remain in the FreeRTOS heap. This can be viewed in the terminal IO window within the IAR Embedded Workbench. */ printf( "%d bytes of heap space remain unallocated/n", xPortGetFreeHeapSize() ); for( ;; ) { /* Wait for a message to be received. Using portMAX_DELAY as the block time will result in an indefinite wait provided INCLUDE_vTaskSuspend is set to 1 in FreeRTOSConfig.h, therefore there is no need to check the function return value and the function will only return when a value has been received. */ xQueueReceive( xLCDQueue, &xReceivedMessage, portMAX_DELAY ); /* Clear the LCD if no room remains for any more text output. */ if( lLine > Line9 ) { LCD_Clear( Blue ); lLine = 0; } /* What is this message? What does it contain? */ switch( xReceivedMessage.cMessageID ) { case mainMESSAGE_BUTTON_UP : /* The button poll task has just informed this task that the up button on the joystick input has been pressed or released. */ sprintf( cBuffer, "Button up = %d", xReceivedMessage.lMessageValue ); break; case mainMESSAGE_BUTTON_SEL : /* The select button interrupt just informed this task that the select button was pressed. Generate a table of task run time statistics and output this to the terminal IO window in the IAR embedded workbench. */ printf( "/nTask/t Abs Time/t %%Time/n*****************************************" ); vTaskGetRunTimeStats( cBuffer ); printf( cBuffer ); /* Also print out a message to the LCD - in this case the pointer to the string to print is sent directly in the lMessageValue member of the message. This just demonstrates a different communication technique. */ sprintf( cBuffer, "%s", ( char * ) xReceivedMessage.lMessageValue ); break; case mainMESSAGE_STATUS : /* The tick interrupt hook function has just informed this task of the system status. Generate a string in accordance with the status value. */ prvGenerateStatusMessage( cBuffer, xReceivedMessage.lMessageValue ); break; default : sprintf( cBuffer, "Unknown message" ); break; } /* Output the message that was placed into the cBuffer array within the switch statement above. */ LCD_DisplayStringLine( lLine, ( uint8_t * ) cBuffer ); /* Move onto the next LCD line, ready for the next iteration of this loop. */ lLine += lFontHeight; }}
开发者ID:peterliu2,项目名称:FreeRTOS,代码行数:89,
示例12: vRs485Taskvoid vRs485Task(void *pvParameters){ int bufsize = 512; uint8 buffer[bufsize]; GPIO_InitTypeDef GPIO_InitStructure; GPIO_InitStructure.GPIO_Pin = GPIO_Pin_14; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_10MHz; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; GPIO_Init(GPIOB, &GPIO_InitStructure); uart3Init(9600/2); //xComPortHandle porthandle = xSerialPortInitMinimal(9600,1024); buffer[0]='W'; buffer[1]='A'; buffer[2]='R'; buffer[3]='E'; buffer[4]='F'; GPIO_ResetBits(GPIOB, GPIO_Pin_14);int heapSize = 0; while (1) { heapSize = xPortGetFreeHeapSize(); heapSize +=0; if (AskConunter()) { vTaskDelay(10); } else { rs485size = iecProcExitPacket(rs485buf); GPIO_SetBits(GPIOB, GPIO_Pin_14); vTaskDelay(1); processBuffer8to7(rs485buf,rs485size); uart3Write ((uint8*) rs485buf, rs485size); vTaskDelay(300); vTaskDelay(20); } } /* signed char bufvar = 0; while (1) { int cnt = uart3Read(buffer,bufsize); vTaskDelay(10); GPIO_SetBits(GPIOB, GPIO_Pin_14); vTaskDelay(2); if(cnt>0) { uart3Write(buffer,cnt); //vTaskDelay(10); //uart3Write(&buffer[1],1); //uart3Write(&buffer[2],1); } vTaskDelay(5); GPIO_ResetBits(GPIOB, GPIO_Pin_14); vTaskDelay(10); }*/}
开发者ID:FlameN,项目名称:STM32RUNO,代码行数:65,
示例13: prvQueryHeapCommand static BaseType_t prvQueryHeapCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString ) { /* Remove compile time warnings about unused parameters, and check the write buffer is not NULL. NOTE - for simplicity, this example assumes the write buffer length is adequate, so does not check for buffer overflows. */ ( void ) pcCommandString; ( void ) xWriteBufferLen; configASSERT( pcWriteBuffer ); sprintf( pcWriteBuffer, "Current free heap %d bytes, minimum ever free heap %d bytes/r/n", ( int ) xPortGetFreeHeapSize(), ( int ) xPortGetMinimumEverFreeHeapSize() ); /* There is no more data to return after this single string, so return pdFALSE. */ return pdFALSE; }
开发者ID:asna121,项目名称:-Play--Command_Line,代码行数:15,
示例14: cmd_get_telemetry_beaconstatic retval_t cmd_get_telemetry_beacon(const subsystem_t *self, frame_t * iframe, frame_t * oframe) { frame_put_u32(oframe, xPortGetFreeHeapSize()); FUTURE_HOOK_2(mm_cmd_get_telemetry_beacon, iframe, oframe); return RV_SUCCESS;}
开发者ID:gabrielrezzonico,项目名称:canopus,代码行数:6,
示例15: ReadBootVersion resp = ReadBootVersion(tempVal); if(resp == IAP_CMD_SUCCESS) { printf("Boot Code Version: %u.%u/r/n", (uint8_t)((tempVal[0]>>8)&0xFF), (uint8_t)(tempVal[0]&0xFF)); } printf("----------------------------/r/n"); printf("Task Name/tStack Usage/r/n"); printf("----------------------------/r/n"); printf("vTaskLed1/t%u/64/r/n", 64-uxTaskGetStackHighWaterMark(TaskList[0])); printf("vConsole/t%u/300/r/n", 300-uxTaskGetStackHighWaterMark(TaskList[1])); printf("vOLEDTask/t%u/200/r/n", 200-uxTaskGetStackHighWaterMark(TaskList[2])); printf("vTimer/t/t%u/150/r/n", 150-uxTaskGetStackHighWaterMark(TaskList[3])); printf("----------------------------/r/n"); printf("Free Heap Space: %u/r/n", xPortGetFreeHeapSize()); printf("Compile Time: %s, %s/r/n", __DATE__, __TIME__); } return 0;}//i2cscanstatic int _F3_Handler (void){ i2c_probe_slaves(I2C0); return 0;}
开发者ID:ilikecake,项目名称:network-analyzer,代码行数:29,
示例16: systemTaskvoid systemTask(void *arg){ bool pass = true; ledInit(); ledSet(CHG_LED, 1);#ifdef DEBUG_QUEUE_MONITOR queueMonitorInit();#endif uartInit();#ifdef ENABLE_UART1 uart1Init();#endif#ifdef ENABLE_UART2 uart2Init();#endif //Init the high-levels modules systemInit();#ifndef USE_RADIOLINK_CRTP#ifdef UART_OUTPUT_TRACE_DATA //debugInitTrace();#endif#ifdef ENABLE_UART// uartInit();#endif#endif //ndef USE_RADIOLINK_CRTP commInit(); commanderAdvancedInit(); stabilizerInit();#ifdef PLATFORM_CF2 deckInit(); #endif soundInit(); memInit();#ifdef PROXIMITY_ENABLED proximityInit();#endif //Test the modules pass &= systemTest(); pass &= configblockTest(); pass &= commTest(); pass &= commanderAdvancedTest(); pass &= stabilizerTest();#ifdef PLATFORM_CF2 pass &= deckTest(); #endif pass &= soundTest(); pass &= memTest(); pass &= watchdogNormalStartTest(); //Start the firmware if(pass) { selftestPassed = 1; systemStart(); soundSetEffect(SND_STARTUP); ledseqRun(SYS_LED, seq_alive); ledseqRun(LINK_LED, seq_testPassed); } else { selftestPassed = 0; if (systemTest()) { while(1) { ledseqRun(SYS_LED, seq_testPassed); //Red passed == not passed! vTaskDelay(M2T(2000)); // System can be forced to start by setting the param to 1 from the cfclient if (selftestPassed) { DEBUG_PRINT("Start forced./n"); systemStart(); break; } } } else { ledInit(); ledSet(SYS_LED, true); } } DEBUG_PRINT("Free heap: %d bytes/n", xPortGetFreeHeapSize()); workerLoop(); //Should never reach this point! while(1) vTaskDelay(portMAX_DELAY);}
开发者ID:DroneBucket,项目名称:Drone_Bucket_CrazyFlie_Firmware,代码行数:98,
示例17: onAccept void onAccept() { os_printf("Accept, port:%d!/n", port); uint16_t remainingHeap = xPortGetFreeHeapSize(); os_printf("on accept: remaining heap: %dB!/n", remainingHeap / 10); }
开发者ID:Lembed,项目名称:ROS-FreeRTOS-STM32,代码行数:6,
示例18: PrintStatusstatic uint8_t PrintStatus( Shell_ConstStdIO_t *io ){#if configUSE_TRACE_FACILITY || configGENERATE_RUN_TIME_STATS /* FreeRTOS trace feature enabled */#if configFRTOS_MEMORY_SCHEME==1 /* this scheme does not allow deallocation of memory */ static unsigned char *taskListBufferP=NULL; /* allocated only once, never deallocated! */#else unsigned char *taskListBufferP;#endif size_t bufSize;#endif uint8_t buf[16]; Shell_SendStatusStr((unsigned char*) "rtos", (unsigned char*) "/r/n", io->stdOut);#if 0 && configUSE_TRACE_FACILITY /* FreeRTOS trace feature enabled */ Shell_SendStr((unsigned char*)"TASK LIST:/r/n", io->stdOut); buf[0] = '/0'; strcatPad(buf, sizeof(buf), (const unsigned char*)"Name", ' ', configMAX_TASK_NAME_LEN); Shell_SendStr(buf, io->stdOut); Shell_SendStr((unsigned char*)"/tState/tPrio/tStack/tTCB#/r/n", io->stdOut); Shell_SendStr((unsigned char*)CLS1_DASH_LINE, io->stdOut); Shell_SendStr((unsigned char*)"/r/n", io->stdOut); /* task list and status */ bufSize = 40*uxTaskGetNumberOfTasks(); /* about 40 bytes for a task should be enough */#if configFRTOS_MEMORY_SCHEME==1 /* this scheme does not allow deallocation of memory */ if (taskListBufferP==NULL) { /* only if not allocated yet */ taskListBufferP = FRTOS1_pvPortMalloc(bufSize); /* about 40 bytes for a task should be enough */ }#else taskListBufferP = FRTOS1_pvPortMalloc(bufSize); /* about 40 bytes for a task should be enough */#endif if (taskListBufferP != NULL) { vTaskList((char*)taskListBufferP, bufSize); Shell_SendStr(taskListBufferP, io->stdOut);#if configFRTOS_MEMORY_SCHEME!=1 /* this scheme does not allow deallocation of memory */ vPortFree(taskListBufferP);#endif } else { Shell_SendStr((unsigned char*)"/r/n*** out of heap! ***/r/n", io->stdErr); }#endif#if ((configGENERATE_RUN_TIME_STATS==1) && (configUSE_STATS_FORMATTING_FUNCTIONS==1)) Shell_SendStr((unsigned char*)CLS1_DASH_LINE, io->stdOut); Shell_SendStr((unsigned char*)"/r/nRTOS RUN-TIME STATISTICS:/r/n", io->stdOut); buf[0] = '/0'; custom_strcatPad(buf, sizeof(buf), (const unsigned char*)"Name", ' ', configMAX_TASK_NAME_LEN); Shell_SendStr(buf, io->stdOut); Shell_SendStr((unsigned char*)"/tTime/t/t%Time/r/n", io->stdOut); Shell_SendStr((unsigned char*)CLS1_DASH_LINE, io->stdOut); Shell_SendStr((unsigned char*)"/r/n", io->stdOut); /* task list and status */ bufSize = 40*uxTaskGetNumberOfTasks(); /* about 40 bytes for a task should be enough */#if configFRTOS_MEMORY_SCHEME==1 /* this scheme does not allow deallocation of memory */ if (taskListBufferP==NULL) { /* only if not allocated yet */ taskListBufferP = FRTOS1_pvPortMalloc(bufSize); }#else taskListBufferP = FRTOS1_pvPortMalloc(bufSize);#endif if (taskListBufferP != NULL) { FRTOS1_vTaskGetRunTimeStats((char*)taskListBufferP, bufSize); Shell_SendStr(taskListBufferP, io->stdOut);#if configFRTOS_MEMORY_SCHEME!=1 /* this scheme does not allow deallocation of memory */ FRTOS1_vPortFree(taskListBufferP);#endif } else { Shell_SendStr((unsigned char*)"/r/n*** out of heap! ***/r/n", io->stdErr); }#endif Shell_SendStatusStr((unsigned char*) " RTOS ticks", (const unsigned char*) "", io->stdOut); num16sToStr(buf, sizeof(buf), configTICK_RATE_HZ); Shell_SendStr(buf, io->stdOut); Shell_SendStr((unsigned char*) " Hz, ", io->stdOut); num16sToStr(buf, sizeof(buf), 1000 / configTICK_RATE_HZ); Shell_SendStr(buf, io->stdOut); Shell_SendStr((unsigned char*) " ms/r/n", io->stdOut);#if configFRTOS_MEMORY_SCHEME!=3 /* wrapper to malloc() does not have xPortGetFreeHeapSize() */ Shell_SendStatusStr((unsigned char*) " Free heap", (const unsigned char*) "", io->stdOut); num32uToStr(buf, sizeof(buf), xPortGetFreeHeapSize()); Shell_SendStr(buf, io->stdOut); Shell_SendStr((unsigned char*) " bytes/r/n", io->stdOut);#endif return ERR_OK;}
开发者ID:AlexanderWiniger,项目名称:LoRaMac-node,代码行数:83,
示例19: nghttp2_session_del nghttp2_session_del(connection.session); mbedtls_ssl_close_notify( &(pclient->ssl) ); mbedtls_net_free( &pclient->fd ); mbedtls_x509_crt_free( &(ssl_config->verify_source.cacertl) ); mbedtls_ssl_free( &(pclient->ssl) ); mbedtls_ssl_config_free( &(ssl_config->conf) ); mbedtls_ctr_drbg_free(&ctr_drbg); mbedtls_entropy_free(&entropy); request_free(&req); return 0; } printf("nghttp2client_test_entry begin!/r/n"); mfs = xPortGetFreeHeapSize(); printf("mfs 1 =%d/r/n", mfs); memset(&ssl, 0, sizeof(http2_ssl_custom_conf_t)); parse_uri(&uri, url_buffer); ret = nghttp2client_connect(&client, url_buffer, HTTPS_PORT, &ssl, &uri); mfs = xPortGetFreeHeapSize(); printf("mfs 2 =%d/r/n", mfs); if(ret != 0) { void http11client_test_entry(char* url_path)
开发者ID:iamblue,项目名称:ml-http2,代码行数:31,
示例20: prvCheckTask//.........这里部分代码省略......... if( xAreTimerDemoTasksStillRunning( xCycleFrequency ) != pdTRUE ) { pcStatusMessage = "Error: TimerDemo"; } } #endif if( xAreTaskNotificationTasksStillRunning() != pdTRUE ) { pcStatusMessage = "Error: Notification"; } if( xAreInterruptSemaphoreTasksStillRunning() != pdTRUE ) { pcStatusMessage = "Error: IntSem"; } else if( xAreEventGroupTasksStillRunning() != pdTRUE ) { pcStatusMessage = "Error: EventGroup"; } else if( xAreIntegerMathsTaskStillRunning() != pdTRUE ) { pcStatusMessage = "Error: IntMath"; } else if( xAreGenericQueueTasksStillRunning() != pdTRUE ) { pcStatusMessage = "Error: GenQueue"; } else if( xAreQueuePeekTasksStillRunning() != pdTRUE ) { pcStatusMessage = "Error: QueuePeek"; } else if( xAreBlockingQueuesStillRunning() != pdTRUE ) { pcStatusMessage = "Error: BlockQueue"; } else if( xAreSemaphoreTasksStillRunning() != pdTRUE ) { pcStatusMessage = "Error: SemTest"; } else if( xArePollingQueuesStillRunning() != pdTRUE ) { pcStatusMessage = "Error: PollQueue"; } else if( xAreMathsTaskStillRunning() != pdPASS ) { pcStatusMessage = "Error: Flop"; } else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE ) { pcStatusMessage = "Error: RecMutex"; } else if( xAreCountingSemaphoreTasksStillRunning() != pdTRUE ) { pcStatusMessage = "Error: CountSem"; } else if( xIsCreateTaskStillRunning() != pdTRUE ) { pcStatusMessage = "Error: Death"; } else if( xAreDynamicPriorityTasksStillRunning() != pdPASS ) { pcStatusMessage = "Error: Dynamic"; } else if( xAreQueueSetTasksStillRunning() != pdPASS ) { pcStatusMessage = "Error: Queue set"; } else if( xIsQueueOverwriteTaskStillRunning() != pdPASS ) { pcStatusMessage = "Error: Queue overwrite"; } else if( xAreQueueSetPollTasksStillRunning() != pdPASS ) { pcStatusMessage = "Error: Queue set polling"; } else if( xAreBlockTimeTestTasksStillRunning() != pdPASS ) { pcStatusMessage = "Error: Block time"; } else if( xAreAbortDelayTestTasksStillRunning() != pdPASS ) { pcStatusMessage = "Error: Abort delay"; } #if( configSUPPORT_STATIC_ALLOCATION == 1 ) else if( xAreStaticAllocationTasksStillRunning() != pdPASS ) { pcStatusMessage = "Error: Static allocation"; } #endif /* configSUPPORT_STATIC_ALLOCATION */ /* This is the only task that uses stdout so its ok to call printf() directly. */ printf( "%s - tick count %d - free heap %d - min free heap %d/r/n", pcStatusMessage, xTaskGetTickCount(), xPortGetFreeHeapSize(), xPortGetMinimumEverFreeHeapSize() ); }}
开发者ID:AlexShiLucky,项目名称:freertos,代码行数:101,
示例21: systemTaskvoid systemTask(void *arg){ bool pass = true; ledInit(); ledSet(CHG_LED, 1); uartInit(); //Init the high-levels modules systemInit();#ifndef USE_RADIOLINK_CRTP#ifdef UART_OUTPUT_TRACE_DATA //debugInitTrace();#endif#ifdef ENABLE_UART// uartInit();#endif#endif //ndef USE_RADIOLINK_CRTP commInit(); DEBUG_PRINT("----------------------------/n"); DEBUG_PRINT("Crazyflie is up and running!/n"); DEBUG_PRINT("Build %s:%s (%s) %s/n", V_SLOCAL_REVISION, V_SREVISION, V_STAG, (V_MODIFIED)?"MODIFIED":"CLEAN"); DEBUG_PRINT("I am 0x%X%X%X and I have %dKB of flash!/n", *((int*)(MCU_ID_ADDRESS+8)), *((int*)(MCU_ID_ADDRESS+4)), *((int*)(MCU_ID_ADDRESS+0)), *((short*)(MCU_FLASH_SIZE_ADDRESS))); commanderInit(); stabilizerInit(); expbrdInit(); memInit(); //Test the modules pass &= systemTest(); pass &= configblockTest(); pass &= commTest(); pass &= commanderTest(); pass &= stabilizerTest(); pass &= expbrdTest(); pass &= memTest(); //Start the firmware if(pass) { selftestPassed = 1; systemStart(); ledseqRun(SYS_LED, seq_alive); ledseqRun(LINK_LED, seq_testPassed); } else { selftestPassed = 0; if (systemTest()) { while(1) { ledseqRun(SYS_LED, seq_testPassed); //Red passed == not passed! vTaskDelay(M2T(2000)); // System can be forced to start by setting the param to 1 from the cfclient if (selftestPassed) { DEBUG_PRINT("Start forced./n"); systemStart(); break; } } } else { ledInit(); ledSet(SYS_LED, true); } } DEBUG_PRINT("Free heap: %d bytes/n", xPortGetFreeHeapSize()); workerLoop(); //Should never reach this point! while(1) vTaskDelay(portMAX_DELAY);}
开发者ID:Gautumn,项目名称:crazyflie-firmware-Keil,代码行数:84,
示例22: systemTaskvoid systemTask(void *arg){ bool pass = true; ledInit(); ledSet(CHG_LED, 1);#ifdef DEBUG_QUEUE_MONITOR queueMonitorInit();#endif#ifdef ENABLE_UART1 uart1Init();#endif#ifdef ENABLE_UART2 uart2Init();#endif //Init the high-levels modules systemInit(); commInit(); commanderInit(); StateEstimatorType estimator = anyEstimator; deckInit(); estimator = deckGetRequiredEstimator(); stabilizerInit(estimator); if (deckGetRequiredLowInterferenceRadioMode()) { platformSetLowInterferenceRadioMode(); } soundInit(); memInit();#ifdef PROXIMITY_ENABLED proximityInit();#endif //Test the modules pass &= systemTest(); pass &= configblockTest(); pass &= commTest(); pass &= commanderTest(); pass &= stabilizerTest(); pass &= deckTest(); pass &= soundTest(); pass &= memTest(); pass &= watchdogNormalStartTest(); //Start the firmware if(pass) { selftestPassed = 1; systemStart(); soundSetEffect(SND_STARTUP); ledseqRun(SYS_LED, seq_alive); ledseqRun(LINK_LED, seq_testPassed); } else { selftestPassed = 0; if (systemTest()) { while(1) { ledseqRun(SYS_LED, seq_testPassed); //Red passed == not passed! vTaskDelay(M2T(2000)); // System can be forced to start by setting the param to 1 from the cfclient if (selftestPassed) { DEBUG_PRINT("Start forced./n"); systemStart(); break; } } } else { ledInit(); ledSet(SYS_LED, true); } } DEBUG_PRINT("Free heap: %d bytes/n", xPortGetFreeHeapSize()); workerLoop(); //Should never reach this point! while(1) vTaskDelay(portMAX_DELAY);}
开发者ID:JJJJJJJack,项目名称:crazyflie-firmware,代码行数:90,
示例23: __attribute__//.........这里部分代码省略.........#if defined(MAKE_CUTE) || defined (MAKE_BIT_CUTE) #if defined (VME) && defined (INCLUDE_LWIP_SMC) // pci bus enumeration must have been run InitialiseVMEDevice(); #endif#endif sysDebugWriteString ("Rajan--> Step2/n");#ifdef INCLUDE_DEBUG_VGA vgaPutsXY( 0, startLine, "FreeRTOS starting..../n/n" ); startLine += 2;#endif board_service(SERVICE__BRD_POST_SCAN_INIT, NULL, NULL); // post scan H/W initialisations board_service(SERVICE__BRD_ENABLE_SMIC_LPC_IOWINDOW, NULL, NULL); /* board-specific smic Initialization */ /* * Having got this far, clear the load error that we've been holding in CMOS */ nvdata.dNvToken = NV__TEST_NUMBER; nvdata.dData = 0; board_service(SERVICE__BRD_NV_WRITE, NULL, &nvdata); nvdata.dNvToken = NV__ERROR_CODE; nvdata.dData = E__BOARD_HANG; board_service(SERVICE__BRD_NV_WRITE, NULL, &nvdata); #ifdef INCLUDE_MAIN_DEBUG DBLOG( "CUTE/BIT Kernel heap: 0x%08x-0x%08x/n", (UINT32)K_HEAP, ((UINT32)K_HEAP + HEAP_SIZE - 1) ); DBLOG( "CUTE/BIT User heap : 0x%08x-0x%08x/n", (UINT32)U_HEAP, ((UINT32)U_HEAP + HEAP_SIZE - 1) ); xPortGetFreeHeapSize();#endif /* Initialise task data */ vTaskDataInit( bCpuCount ); /* Initialise PCI shared interrupt handling */ pciIntInit();#ifdef INCLUDE_MAIN_DEBUG pciListDevs( 0 );#endif /* Create and start the network */ sysDebugWriteString ("Initializing: Network/n"); networkInit();#if defined(SRIO) sysDebugWriteString ("Initializing: TSI721/n"); for (i = 1 ; i < MAX_TSI721_DEVS; i++) { tsi721_init(i); } rio_init_mports(); #endif // some boards may not reset the RTC cleanly board_service(SERVICE__BRD_INIT_RTC, NULL, NULL);
开发者ID:testing-ishita,项目名称:test2,代码行数:66,
示例24: _SYS_Tasks/******************************************************************************* Function: void _SYS_Tasks ( void ) Summary: Maintains state machines of system modules.*/static void _SYS_Tasks ( void){ TIMEOUT_THREAD_0_START; while(1) { /* Maintain system services */ SYS_DEVCON_Tasks(sysObj.sysDevcon); /* Maintain the file system state machine. */ SYS_FS_Tasks(); SYS_CONSOLE_Tasks(sysObj.sysConsole0); /* SYS_COMMAND layer tasks routine */ SYS_CMD_Tasks(); /* SYS_TMR Device layer tasks routine */ SYS_TMR_Tasks(sysObj.sysTmr); /* Maintain Device Drivers */ DRV_SST25VF064C_Tasks(sysObj.drvSst25vf064c0); DRV_SDCARD_Tasks(sysObj.drvSDCard); /* Maintain Middleware */ NET_PRES_Tasks(sysObj.netPres); /* Maintain the TCP/IP Stack*/ wdt_arm_thread_0(); wdt_kick(); if(TIMEOUT_THREAD_0(10)) { TIMEOUT_THREAD_0_START; SYS_DEBUG(SYS_ERROR_INFO, "MON: SYS Stack size: %d/r/n",uxTaskGetStackHighWaterMark(NULL)); size_t libc_heap_usage_total = TrackHeap_TotalUsage(); size_t libc_heap_usage_max = TrackHeap_MaxUsage(); SYS_DEBUG(SYS_ERROR_INFO, "MON: heap usage: %dKB (%dKB), free: %dKB/r/n", libc_heap_usage_total / 1024, libc_heap_usage_max / 1024,xPortGetFreeHeapSize() / 1024); } /* Task Delay */ vTaskDelay(1 / portTICK_PERIOD_MS); }}
开发者ID:xuezhongbo,项目名称:gateway,代码行数:44,
示例25: vServiceTaskstatic void vServiceTask( void *pvParameters ){ int last_backlight = -1; int last_contrast = -1; char last_repeater_mode = 0; char last_parrot_mode = 0; char dcs_boot_timer = 8; // bool update = true; bool last_rmu_enabled = false; for (;;) { vTaskDelay(500); // gpio_toggle_pin(AVR32_PIN_PB28); //gpio_toggle_pin(AVR32_PIN_PB18); // x_counter ++; // rtclock_disp_xy(84, 0, x_counter & 0x02, 1); rtclock_disp_xy(84, 0, 2, 1); vdisp_i2s( tmp_buf, 5, 10, 0, voltage); tmp_buf[3] = tmp_buf[2]; tmp_buf[2] = '.'; tmp_buf[4] = 'V'; tmp_buf[5] = 0; vdisp_prints_xy( 55, 0, VDISP_FONT_4x6, 0, tmp_buf ); // vdisp_i2s( tmp_buf, 5, 10, 0, serial_rx_error ); // vd_prints_xy(VDISP_DEBUG_LAYER, 108, 28, VDISP_FONT_4x6, 0, tmp_buf ); vdisp_i2s( tmp_buf, 5, 10, 0, serial_rx_ok ); vd_prints_xy(VDISP_DEBUG_LAYER, 108, 34, VDISP_FONT_4x6, 0, tmp_buf ); // vdisp_i2s( tmp_buf, 5, 10, 0, serial_timeout_error ); vdisp_i2s( tmp_buf, 5, 10, 0, dstar_pos_not_correct ); vd_prints_xy(VDISP_DEBUG_LAYER, 108, 40, VDISP_FONT_4x6, 0, tmp_buf ); vdisp_i2s( tmp_buf, 5, 10, 0, serial_putc_q_full ); vd_prints_xy(VDISP_DEBUG_LAYER, 108, 46, VDISP_FONT_4x6, 0, tmp_buf ); vdisp_i2s( tmp_buf, 5, 10, 0, initialHeapSize ); vd_prints_xy(VDISP_DEBUG_LAYER, 108, 52, VDISP_FONT_4x6, 0, tmp_buf ); vdisp_i2s( tmp_buf, 5, 10, 0, xPortGetFreeHeapSize() ); vd_prints_xy(VDISP_DEBUG_LAYER, 108, 58, VDISP_FONT_4x6, 0, tmp_buf ); int v = 0; switch (eth_autoneg_state) { case 0: if (SETTING_BOOL(B_ONLY_TEN_MBIT)) { AVR32_MACB.man = 0x50920061; // write register 0x04, advertise only 10MBit/s for autoneg } eth_autoneg_state = 1; break; case 1: AVR32_MACB.man = 0x50821200; // write register 0x00, power on, autoneg, restart autoneg eth_autoneg_state = 2; break; case 2: AVR32_MACB.man = 0x60C20000; // read register 0x10 eth_autoneg_state = 3; break; case 3: v = AVR32_MACB.MAN.data; // read data from previously read register 0x10 AVR32_MACB.man = 0x60C20000; // read register 0x10 break; } dvset(); nodeinfo_print(); if (last_rmu_enabled != rmu_enabled) { rmuset_print(); last_rmu_enabled = rmu_enabled; } const char * net_status = " "; dhcp_set_link_state( v & 1 ); if (v & 1) // Ethernet link is active { v = ((v >> 1) & 0x03) ^ 0x01; switch (v) { case 0://.........这里部分代码省略.........
开发者ID:rballis,项目名称:up4dar-os,代码行数:101,
示例26: RtlUpSema RtlUpSema(&rtsp_ctx->start_rtp_sema); } }out: rtsp_ctx->state = RTSP_INIT; close(client_socket); } } exit: if((rtsp_ctx->is_rtp_start) == 1){ RtlUpSema(&rtsp_ctx->start_rtp_sema); } printf("/n/rrtsp -> Available heap 0x%x/n/r", xPortGetFreeHeapSize()); close(client_socket); close(rtsp_ctx->connect_ctx.socket_id); if(request_header != NULL) free(request_header); /*wait until rtp task being destroyed*/ while((rtsp_ctx->is_rtp_start)) { vTaskDelay(100); } rtsp_context_free(rtsp_ctx); if(rtsp_ctx != NULL) free(rtsp_ctx); RTSP_ERROR("/n/rkill rtsp server thread!"); //printf("Available heap 0x%x/n", xPortGetFreeHeapSize()); //thread must be killed after server socket is terminated
开发者ID:alex1818,项目名称:rtk-8711af,代码行数:31,
示例27: prvLCDTaskstatic void prvLCDTask( void *pvParameters ){xQueueMessage xReceivedMessage;/* Buffer into which strings are formatted and placed ready for display on theLCD. Note this is a static variable to prevent it being allocated on the taskstack, which is too small to hold such a variable. The stack size is configuredwhen the task is created. */static char cBuffer[ 50 ];unsigned char ucLine = 1; /* Now the scheduler has been started (it must have been for this task to be running), start the check timer too. The call to xTimerStart() will block until the command has been accepted. */ if( xCheckTimer != NULL ) { xTimerStart( xCheckTimer, portMAX_DELAY ); } /* This is the only function that is permitted to access the LCD. First print out the number of bytes that remain in the FreeRTOS heap. This is done after a short delay to ensure all the demo tasks have created all the objects they are going to use. */ vTaskDelay( mainTIMER_TEST_PERIOD * 10 ); sprintf( cBuffer, "%d heap free", ( int ) xPortGetFreeHeapSize() ); halLcdPrintLine( cBuffer, ucLine, OVERWRITE_TEXT ); ucLine++; /* Just as a test of the port, and for no functional reason, check the task parameter contains its expected value. */ if( pvParameters != mainTASK_PARAMETER_CHECK_VALUE ) { halLcdPrintLine( "Invalid parameter", ucLine, OVERWRITE_TEXT ); ucLine++; } for( ;; ) { /* Wait for a message to be received. Using portMAX_DELAY as the block time will result in an indefinite wait provided INCLUDE_vTaskSuspend is set to 1 in FreeRTOSConfig.h, therefore there is no need to check the function return value and the function will only return when a value has been received. */ xQueueReceive( xLCDQueue, &xReceivedMessage, portMAX_DELAY ); /* Clear the LCD if no room remains for any more text output. */ if( ucLine > mainMAX_LCD_LINES ) { halLcdClearScreen(); ucLine = 0; } /* What is this message? What does it contain? */ switch( xReceivedMessage.cMessageID ) { case mainMESSAGE_BUTTON_UP : /* The button poll task has just informed this task that the up button on the joystick input has been pressed or released. */ sprintf( cBuffer, "Button up = %d", ( int ) xReceivedMessage.ulMessageValue ); break; case mainMESSAGE_BUTTON_SEL : /* The select button interrupt just informed this task that the select button has been pressed. In this case the pointer to the string to print is sent directly in the ulMessageValue member of the message. This just demonstrates a different communication technique. */ sprintf( cBuffer, "%s", ( char * ) xReceivedMessage.ulMessageValue ); break; case mainMESSAGE_STATUS : /* The tick interrupt hook function has just informed this task of the system status. Generate a string in accordance with the status value. */ prvGenerateStatusMessage( cBuffer, xReceivedMessage.ulMessageValue ); break; default : sprintf( cBuffer, "Unknown message" ); break; } /* Output the message that was placed into the cBuffer array within the switch statement above, then move onto the next line ready for the next message to arrive on the queue. */ halLcdPrintLine( cBuffer, ucLine, OVERWRITE_TEXT ); ucLine++; }}
开发者ID:Bjoe,项目名称:msp340x-msp340-5438-stk-ccs,代码行数:94,
示例28: http_get_task//.........这里部分代码省略......... printf(" ok/n"); /* OPTIONAL is not optimal for security, in this example it will print a warning if CA verification fails but it will continue to connect. */ mbedtls_ssl_conf_authmode(&conf, MBEDTLS_SSL_VERIFY_OPTIONAL); mbedtls_ssl_conf_ca_chain(&conf, &cacert, NULL); mbedtls_ssl_conf_rng(&conf, mbedtls_ctr_drbg_random, &ctr_drbg);#ifdef MBEDTLS_DEBUG_C mbedtls_debug_set_threshold(DEBUG_LEVEL); mbedtls_ssl_conf_dbg(&conf, my_debug, stdout);#endif if((ret = mbedtls_ssl_setup(&ssl, &conf)) != 0) { printf(" failed/n ! mbedtls_ssl_setup returned %d/n/n", ret); goto exit; } /* Wait until we can resolve the DNS for the server, as an indication our network is probably working... */ printf("Waiting for server DNS to resolve... "); err_t dns_err; ip_addr_t host_ip; do { vTaskDelay(500 / portTICK_PERIOD_MS); dns_err = netconn_gethostbyname(WEB_SERVER, &host_ip); } while(dns_err != ERR_OK); printf("done./n"); while(1) { mbedtls_net_init(&server_fd); printf("top of loop, free heap = %u/n", xPortGetFreeHeapSize()); /* * 1. Start the connection */ printf(" . Connecting to %s:%s...", WEB_SERVER, WEB_PORT); if((ret = mbedtls_net_connect(&server_fd, WEB_SERVER, WEB_PORT, MBEDTLS_NET_PROTO_TCP)) != 0) { printf(" failed/n ! mbedtls_net_connect returned %d/n/n", ret); goto exit; } printf(" ok/n"); mbedtls_ssl_set_bio(&ssl, &server_fd, mbedtls_net_send, mbedtls_net_recv, NULL); /* * 4. Handshake */ printf(" . Performing the SSL/TLS handshake..."); while((ret = mbedtls_ssl_handshake(&ssl)) != 0) { if(ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE) { printf(" failed/n ! mbedtls_ssl_handshake returned -0x%x/n/n", -ret); goto exit; } } printf(" ok/n");
开发者ID:Cicero-MF,项目名称:esp-open-rtos,代码行数:66,
注:本文中的xPortGetFreeHeapSize函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ xPortRaisePrivilege函数代码示例 C++ xMalloc函数代码示例 |