这篇教程C++ system_get_free_heap_size函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中system_get_free_heap_size函数的典型用法代码示例。如果您正苦于以下问题:C++ system_get_free_heap_size函数的具体用法?C++ system_get_free_heap_size怎么用?C++ system_get_free_heap_size使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了system_get_free_heap_size函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: user_init/****************************************************************************** * FunctionName : user_init * Description : entry of user application, init user function here * Parameters : none * Returns : none *******************************************************************************/void ICACHE_FLASH_ATTR user_init(void) { sys_read_cfg(); if(!syscfg.cfg.b.debug_print_enable) system_set_os_print(0); uart_init();#if USE_TMP2NET_PORT GPIO0_MUX = 0;#else GPIO0_MUX = VAL_MUX_GPIO0_SDK_DEF;#endif GPIO4_MUX = VAL_MUX_GPIO4_SDK_DEF; GPIO5_MUX = VAL_MUX_GPIO5_SDK_DEF; GPIO12_MUX = VAL_MUX_GPIO12_SDK_DEF; GPIO14_MUX = VAL_MUX_GPIO14_SDK_DEF; system_timer_reinit();#if DEBUGSOO > 0 os_printf("/nSimple WEB version: " WEB_SVERSION "/nOpenLoaderSDK v1.2/n");#endif if(syscfg.cfg.b.pin_clear_cfg_enable) test_pin_clr_wifi_config(); set_cpu_clk(); // select cpu frequency 80 or 160 MHz#if DEBUGSOO > 0 if(eraminfo.size > 0) os_printf("Found free IRAM: base: %p, size: %d bytes/n", eraminfo.base, eraminfo.size); os_printf("System memory:/n"); system_print_meminfo(); os_printf("Start 'heap' size: %d bytes/n", system_get_free_heap_size());#endif#if DEBUGSOO > 0 os_printf("Set CPU CLK: %u MHz/n", ets_get_cpu_frequency());#endif Setup_WiFi();#if USE_TMP2NET_PORT tpm2net_init();#endif#ifdef USE_NETBIOS if(syscfg.cfg.b.netbios_ena) netbios_init();#endif/* #ifdef USE_SNTP if(syscfg.cfg.b.sntp_ena) sntp_init();#endif */#ifdef UDP_TEST_PORT if(syscfg.udp_port) udp_test_port_init(syscfg.udp_port);#endif // инициализация и запуск tcp серверa(ов)#ifdef USE_SRV_WEB_PORT if(syscfg.web_port) webserver_init(syscfg.web_port);#endif/// if(syscfg.tcp2uart_port) tcp2uart_init(syscfg.tcp2uart_port);#ifdef USE_MODBUS mdb_tcp_init(502);#endif#ifdef USE_WDRV init_wdrv();#endif system_deep_sleep_set_option(0); system_init_done_cb(init_done_cb);}
开发者ID:diannt,项目名称:esp8266web,代码行数:61,
示例2: user_init// Main routine to initialize esp-link.void user_init(void) { // get the flash config so we know how to init things //configWipe(); // uncomment to reset the config for testing purposes bool restoreOk = configRestore(); // Init gpio pin registers gpio_init(); gpio_output_set(0, 0, 0, (1<<15)); // some people tie it to GND, gotta ensure it's disabled // init UART uart_init(flashConfig.baud_rate, 115200); logInit(); // must come after init of uart // Say hello (leave some time to cause break in TX after boot loader's msg os_delay_us(10000L); os_printf("/n/n** %s/n", esp_link_version); os_printf("Flash config restore %s/n", restoreOk ? "ok" : "*FAILED*"); // Status LEDs statusInit(); serledInit(); // Wifi wifiInit(); // init the flash filesystem with the html stuff espFsInit(&_binary_espfs_img_start); //EspFsInitResult res = espFsInit(&_binary_espfs_img_start); //os_printf("espFsInit %s/n", res?"ERR":"ok"); // mount the http handlers httpdInit(builtInUrls, 80); // init the wifi-serial transparent bridge (port 23) serbridgeInit(23, 2323); uart_add_recv_cb(&serbridgeUartCb);#ifdef SHOW_HEAP_USE os_timer_disarm(&prHeapTimer); os_timer_setfn(&prHeapTimer, prHeapTimerCb, NULL); os_timer_arm(&prHeapTimer, 10000, 1);#endif struct rst_info *rst_info = system_get_rst_info(); NOTICE("Reset cause: %d=%s", rst_info->reason, rst_codes[rst_info->reason]); NOTICE("exccause=%d epc1=0x%x epc2=0x%x epc3=0x%x excvaddr=0x%x depc=0x%x", rst_info->exccause, rst_info->epc1, rst_info->epc2, rst_info->epc3, rst_info->excvaddr, rst_info->depc); uint32_t fid = spi_flash_get_id(); NOTICE("Flash map %s, manuf 0x%02X chip 0x%04X", flash_maps[system_get_flash_size_map()], fid & 0xff, (fid&0xff00)|((fid>>16)&0xff)); NOTICE("** %s: ready, heap=%ld", esp_link_version, (unsigned long)system_get_free_heap_size()); // Init SNTP service cgiServicesSNTPInit();#ifdef MQTT NOTICE("initializing MQTT"); mqtt_client_init();#endif NOTICE("initializing user application"); app_init(); NOTICE("Waiting for work to do...");}
开发者ID:brunnels,项目名称:esp-link,代码行数:55,
示例3: mqttStatusMsgint ICACHE_FLASH_ATTRmqttStatusMsg(char *buf) { sint8 rssi = wifi_station_get_rssi(); if (rssi > 0) rssi = 0; // not connected or other error //os_printf("timer rssi=%d/n", rssi); // compose MQTT message return os_sprintf(buf, "{/"rssi/":%d, /"heap_free/":%ld}", rssi, (unsigned long)system_get_free_heap_size());}
开发者ID:Drummondh,项目名称:esp-link,代码行数:11,
示例4: espconn_server_recv/****************************************************************************** * FunctionName : espconn_server_recv * Description : Data has been received on this pcb. * Parameters : arg -- Additional argument to pass to the callback function * pcb -- The connection pcb which received data * p -- The received data (or NULL when the connection has been closed!) * err -- An error code if there has been an error receiving * Returns : ERR_ABRT: if you have called tcp_abort from within the function!*******************************************************************************/static err_t ICACHE_FLASH_ATTRespconn_server_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err){ espconn_msg *precv_cb = arg; tcp_arg(pcb, arg); espconn_printf("server has application data received: %d/n", system_get_free_heap_size()); if (p != NULL) { tcp_recved(pcb, p->tot_len); } if (err == ERR_OK && p != NULL) { u8_t *data_ptr = NULL; u32_t data_cntr = 0; precv_cb->pcommon.recv_check = 0; data_ptr = (u8_t *)os_zalloc(p ->tot_len + 1); data_cntr = pbuf_copy_partial(p, data_ptr, p ->tot_len, 0); pbuf_free(p); if (data_cntr != 0) { precv_cb->pespconn ->state = ESPCONN_READ; precv_cb->pcommon.pcb = pcb; if (precv_cb->pespconn->recv_callback != NULL) { precv_cb->pespconn->recv_callback(precv_cb->pespconn, data_ptr, data_cntr); } precv_cb->pespconn ->state = ESPCONN_CONNECT; } os_free(data_ptr); data_ptr = NULL; espconn_printf("server's application data has been processed: %d/n", system_get_free_heap_size()); } else { if (p != NULL) { pbuf_free(p); } espconn_server_close(precv_cb, pcb); } return ERR_OK;}
开发者ID:AlexShadow,项目名称:esp8266web,代码行数:50,
示例5: info_cbLOCAL void ICACHE_FLASH_ATTRinfo_cb(void *arg){ wdt_feed(); uart0_sendStr("System Info/r/n"); os_printf("Time=%ld/r/n", system_get_time()); os_printf("Chip id=%ld/r/n", system_get_chip_id()); os_printf("Free heap size=%ld/r/n", system_get_free_heap_size()); uart0_sendStr("Mem info:/r/n"); system_print_meminfo(); uart0_sendStr("/r/n");}
开发者ID:alonewolfx2,项目名称:esp8266-sdk,代码行数:12,
示例6: httpdRetireConn//Retires a connection for re-usestatic void ICACHE_FLASH_ATTR httpdRetireConn(HttpdConnData *conn) { uint32 dt = conn->startTime; if (dt > 0) dt = (system_get_time() - dt)/1000; os_printf("%s Closed, took %ums, heap=%ld/n", connStr, dt, (unsigned long)system_get_free_heap_size()); if (conn->post->buff!=NULL) os_free(conn->post->buff); conn->post->buff=NULL; conn->cgi=NULL; conn->conn=NULL; conn->remote_port = 0; conn->remote_ip[0] = 0;}
开发者ID:alonewolfx2,项目名称:esp-link,代码行数:13,
示例7: mg_mgr_polltime_t mg_mgr_poll(struct mg_mgr *mgr, int timeout_ms) { int n = 0; time_t now = time(NULL); struct mg_connection *nc, *tmp; (void) timeout_ms; DBG(("begin poll, now=%u, hf=%u, sf lwm=%u", (unsigned int) now, system_get_free_heap_size(), 0U)); for (nc = mgr->active_connections; nc != NULL; nc = tmp) { struct mg_lwip_conn_state *cs = (struct mg_lwip_conn_state *) nc->sock; (void) cs; tmp = nc->next; n++; if (nc->flags & MG_F_CLOSE_IMMEDIATELY) { mg_close_conn(nc); continue; } mg_if_poll(nc, now); mg_if_timer(nc, now); if (nc->send_mbuf.len == 0 && (nc->flags & MG_F_SEND_AND_CLOSE) && !(nc->flags & MG_F_WANT_WRITE)) { mg_close_conn(nc); continue; }#ifdef SSL_KRYPTON if (nc->ssl != NULL && cs != NULL && cs->pcb.tcp != NULL && cs->pcb.tcp->state == ESTABLISHED) { if (((nc->flags & MG_F_WANT_WRITE) || nc->send_mbuf.len > 0) && cs->pcb.tcp->snd_buf > 0) { /* Can write more. */ if (nc->flags & MG_F_SSL_HANDSHAKE_DONE) { if (!(nc->flags & MG_F_CONNECTING)) mg_lwip_ssl_send(nc); } else { mg_lwip_ssl_do_hs(nc); } } if (cs->rx_chain != NULL) { if (nc->flags & MG_F_SSL_HANDSHAKE_DONE) { if (!(nc->flags & MG_F_CONNECTING)) mg_lwip_ssl_recv(nc); } else { mg_lwip_ssl_do_hs(nc); } } } else#endif /* SSL_KRYPTON */ { if (!(nc->flags & (MG_F_CONNECTING | MG_F_UDP))) { if (nc->send_mbuf.len > 0) mg_lwip_send_more(nc); } } } DBG(("end poll, %d conns", n)); return now;}
开发者ID:MrZANE42,项目名称:smart.js,代码行数:53,
示例8: user_init/****************************************************************************** * FunctionName : user_init * Description : entry of user application, init user function here * Parameters : none * Returns : none *******************************************************************************/void ICACHE_FLASH_ATTR user_init(void) { if(eraminfo.size > 0) os_printf("Found free IRAM: base: %p, size: %d bytes/n", eraminfo.base, eraminfo.size); os_printf("System memory:/n"); system_print_meminfo(); os_printf("bssi : 0x%x ~ 0x%x, len: %d/n", &_lit4_start, &_lit4_end, (uint32)(&_lit4_end) - (uint32)(&_lit4_start)); os_printf("free : 0x%x ~ 0x%x, len: %d/n", (uint32)(&_lit4_end), (uint32)(eraminfo.base) + eraminfo.size, (uint32)(eraminfo.base) + eraminfo.size - (uint32)(&_lit4_end)); os_printf("Start 'heap' size: %d bytes/n", system_get_free_heap_size()); os_printf("Set CPU CLK: %u MHz/n", ets_get_cpu_frequency()); system_deep_sleep_set_option(0); wifi_set_event_handler_cb(wifi_handle_event_cb); system_init_done_cb(init_done_cb);}
开发者ID:UncleRus,项目名称:MinEspSDKLib,代码行数:18,
示例9: ax_zallocEXP_FUNC void * ICACHE_FLASH_ATTR ax_zalloc(size_t s, const char* file, int line){ void *x; if ((x = (void*)zalloc(s)) == NULL) exit_now("out of memory %s %d/n", file, line); else { debug_now("%s %d point[%p] size[%d] heap[%d]/n", file, line, x, s, system_get_free_heap_size()); //add_mem_info(x, s, file, line); } return x;}
开发者ID:AthenaYu,项目名称:ESP8266_RTOS_SDK,代码行数:13,
示例10: dce_handle_GMEMdce_result_t SECTION_ATTR dce_handle_GMEM(dce_t* dce, void* group_ctx, int kind, size_t argc, arg_t* argv){ char line[12]; int length = sprintf(line, "%d", system_get_free_heap_size()); dce_emit_information_response(dce, line, length); int debug_enabled = uart_get_debug(); uart_set_debug(1); system_print_meminfo(); uart_set_debug(debug_enabled); dce_emit_basic_result_code(dce, DCE_RC_OK);}
开发者ID:aabella,项目名称:atproto,代码行数:13,
示例11: mesh_EnableCb/****************************************************************************** * FunctionName : mesh_EnableCb * Description : callback func for espconn_mesh_enable enable callback will only be called if the device has already joined a mesh network*******************************************************************************/void ICACHE_FLASH_ATTRmesh_EnableCb(){ mesh_StopCheckTimer(); _LINE_DESP(); MESH_INFO("TEST IN MESH ENABLE CB/r/n"); MESH_INFO("%s/n", __func__); MESH_INFO("HEAP: %d /r/n",system_get_free_heap_size()); _LINE_DESP(); if(LightMeshProc.mesh_suc_cb){ LightMeshProc.mesh_suc_cb(NULL); }}
开发者ID:koanpl,项目名称:ESP8266_LIGHT_WITH_MESH,代码行数:18,
示例12: ax_callocEXP_FUNC void * ICACHE_FLASH_ATTR ax_calloc(size_t n, size_t s, const char* file, int line){ void *x; //unsigned total_size =0; if ((x = calloc(n, s)) == NULL) exit_now("out of memory %s %d/n", file, line); else { debug_now("%s %d point[%p] size[%d] heap[%d]/n", file, line, x, s, system_get_free_heap_size()); //total_size = n * s; //add_mem_info (x, total_size, file, line); } return x;}
开发者ID:AthenaYu,项目名称:ESP8266_RTOS_SDK,代码行数:14,
示例13: dhsender_queue_initvoid ICACHE_FLASH_ATTR dhsender_queue_init() { mQueueMaxSize = (system_get_free_heap_size() - MEMORY_RESERVER) / sizeof(DHSENDER_QUEUE); if(mQueueMaxSize > MAX_QUEUE_LENGTH) mQueueMaxSize = MAX_QUEUE_LENGTH; mQueue = (DHSENDER_QUEUE *)os_malloc(mQueueMaxSize * sizeof(DHSENDER_QUEUE)); if(mQueue == 0) { dhdebug("ERROR: can not allocate memory for queue"); } else { if(mQueueMaxSize < 10) dhdebug("Warning: queue is very shot - %u", mQueueMaxSize); else dhdebug("Queue created, size %u", mQueueMaxSize); }}
开发者ID:devicehive,项目名称:esp8266-firmware,代码行数:14,
示例14: MQTT_exitstatic void ICACHE_FLASH_ATTRMQTT_exit(MQTT_Client *client){ if(client == NULL) { return; } if(client->host != NULL) { os_free(client->host); client->host = NULL; } if(client->connect_info.password != NULL) { os_free(client->connect_info.password); client->connect_info.password = NULL; } if(client->connect_info.client_id != NULL) { os_free(client->connect_info.client_id); client->connect_info.client_id = NULL; } if(client->connect_info.username != NULL) { os_free(client->connect_info.username); client->connect_info.username = NULL; } if(client->mqtt_state.in_buffer != NULL) { os_free(client->mqtt_state.in_buffer); client->mqtt_state.in_buffer = NULL; } if(client->mqtt_state.out_buffer != NULL) { os_free(client->mqtt_state.out_buffer); client->mqtt_state.out_buffer = NULL; } if(client->msgQueue.buf != NULL) { os_free(client->msgQueue.buf); client->msgQueue.buf = NULL; } INFO("mqtt exit:/n"); INFO("available heap size:%d/n", system_get_free_heap_size()); if(client->errorCb != NULL) { (client->errorCb)((uint32_t*)client); }}
开发者ID:leeshineSZ,项目名称:tisan_project,代码行数:49,
示例15: init_done_cbvoid ICACHE_FLASH_ATTR init_done_cb(void){ os_printf("/nSDK Init - Ok/nCurrent 'heap' size: %d bytes/n", system_get_free_heap_size());#ifdef USE_WEB web_fini(inifname);#endif switch(system_get_rst_info()->reason) { case REASON_SOFT_RESTART: case REASON_DEEP_SLEEP_AWAKE: break; default: New_WiFi_config(WIFI_MASK_ALL); break; }}
开发者ID:Valdiolus,项目名称:esp8266web,代码行数:15,
示例16: MakeHTTPFooter////////////////////// make html footer////////////////////String MakeHTTPFooter(){ String sResponse; sResponse = F("<FONT SIZE=-2><BR>Aufrufzähler="); sResponse += ulReqcount; sResponse += F(" - Verbindungszähler="); sResponse += ulReconncount; sResponse += F(" - Freies RAM="); sResponse += (uint32_t)system_get_free_heap_size(); sResponse += F(" - Max. Datenpunkte="); sResponse += ulNoMeasValues; sResponse += F("<BR>SMASE 03/2016 | Tobias Winter -> Mail: [email C++ system_get_sdk_version函数代码示例 C++ system_error函数代码示例
|