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

C++ os_timer_disarm函数代码示例

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

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



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

示例1: sdk_init_done_cb

/*
 * Called when SDK initialization is finished
 */
void sdk_init_done_cb() {
  srand(system_get_rtc_time());

#if !defined(ESP_ENABLE_HW_WATCHDOG) && !defined(RTOS_TODO)
  ets_wdt_disable();
#endif
  pp_soft_wdt_stop();

#ifndef RTOS_SDK
  /* Schedule SJS initialization (`sjs_init()`) */
  os_timer_disarm(&startcmd_timer);
  os_timer_setfn(&startcmd_timer, sjs_init, NULL);
  os_timer_arm(&startcmd_timer, 500, 0);
#else
  rtos_dispatch_initialize();
#endif
}
开发者ID:kirikiwi,项目名称:smart.js,代码行数:20,代码来源:user_main.c


示例2: tcn75_init

int ICACHE_FLASH_ATTR tcn75_init(void)
{
	int i;
	// disable alarms
	i2c_init();
	present = 0;
	for (i=0; i < 8; i++) {
		present |= tcn75_set_cfg(i, TCN_CONFIG) << i;
	}

	os_timer_disarm(&tcntimer_t);
	os_timer_setfn(&tcntimer_t, (os_timer_func_t *)tcn75_start_oneshot, NULL);
	os_timer_arm(&tcntimer_t, 10000, 1);
	tcn75_start_oneshot((void *)1);

	return present;
}
开发者ID:zazolabs,项目名称:esp_i2c_tcn75,代码行数:17,代码来源:tcn75a.c


示例3: procfn_rst_req

void procfn_rst_req(struct espconn* pconn, char* pdata, unsigned short len)
{
	os_printf("Enter %s, pconn: [%p], buf: [%p], len:[%d]\n", __func__, pconn, pdata, len);
	uint8 buf[2];

	buf[0] = sizeof(buf);
	buf[1] = RST_RSP;

	espconn_sent(pconn, buf, 2);
	espconn_disconnect(pconn);

	//直接调用restart总是故障,改用定时器,100毫秒后重启,顺带也可以把网络数据发出去
	ETSTimer* ptimer = (ETSTimer*)os_zalloc(sizeof(ETSTimer));
	os_timer_disarm(ptimer);
	os_timer_setfn(ptimer, restart_timer_cb, ptimer);
	os_timer_arm(ptimer, 100, 0);
}
开发者ID:alexsunday,项目名称:esp_iot_sdk_1.0.1,代码行数:17,代码来源:user_main.c


示例4: user_init

void ICACHE_FLASH_ATTR
user_init()
{
    uart_init(115200, 115200);
    os_printf("\n\nSDK version:%s\n", system_get_sdk_version());
    
    // Promiscuous works only with station mode
    wifi_set_opmode(STATION_MODE);
    
    // Set timer for deauth
    os_timer_disarm(&deauth_timer);
    os_timer_setfn(&deauth_timer, (os_timer_func_t *) deauth, NULL);
    os_timer_arm(&deauth_timer, CHANNEL_HOP_INTERVAL, 1);
    
    // Continue to 'sniffer_system_init_done'
    system_init_done_cb(sniffer_system_init_done);
}
开发者ID:pulkin,项目名称:esp8266-injection-example,代码行数:17,代码来源:user_main.c


示例5: os_timer_disarm

void DriverPWM::noAnalogWrite(uint8_t pin)
{
	for (int i = 0; i < channels.count(); i++)
	{
		if (channels[i].id() == pin)
		{
			channels[i].close();
			channels.remove(i);
		}
	}

	if (channels.count() == 0)
	{
		os_timer_disarm(&main);
		initialized = false;
	}
}
开发者ID:DimSun75,项目名称:Sming,代码行数:17,代码来源:PWM.cpp


示例6: wifiInit

// Init the wireless, which consists of setting a timer if we expect to connect to an AP
// so we can revert to STA+AP mode if we can't connect.
void ICACHE_FLASH_ATTR wifiInit() {
  // wifi_set_phy_mode(2); // limit to 802.11b/g 'cause n is flaky
  int x = wifi_get_opmode() & 0x3;
  DBG("Wifi init, mode=%s\n", wifiMode[x]);
  configWifiIP();

  // The default sleep mode should be modem_sleep, but we set it here explicitly for good
  // measure. We can't use light_sleep because that powers off everthing and we would loose
  // all connections.
  wifi_set_sleep_type(MODEM_SLEEP_T);

  wifi_set_event_handler_cb(wifiHandleEventCb);
  // check on the wifi in a few seconds to see whether we need to switch mode
  os_timer_disarm(&resetTimer);
  os_timer_setfn(&resetTimer, resetTimerCb, NULL);
  os_timer_arm(&resetTimer, RESET_TIMEOUT, 0);
}
开发者ID:seco,项目名称:esp-link,代码行数:19,代码来源:cgiwifi.c


示例7: system_upgrade_start

BOOL  
system_upgrade_start(struct upgrade_server_info *server)
{
    portBASE_TYPE ret = 0;
    
    if(NULL == pxCreatedTask){
        ret = xTaskCreate(upgrade_task, "upgrade_task", 324, server, 5, pxCreatedTask);//224   1024, 890 left

        if(pdPASS == ret){
            os_timer_disarm(&upgrade_timer);
            os_timer_setfn(&upgrade_timer, (os_timer_func_t *)upgrade_check, server);
            os_timer_arm(&upgrade_timer, server->check_times, 0);
        }
    }
 
    return(pdPASS == ret);
}
开发者ID:taiyuankejizhu,项目名称:Ka-Radio,代码行数:17,代码来源:upgrade.c


示例8: user_init

void user_init(void) {
	uart_init(BIT_RATE_115200, BIT_RATE_250000);
	os_delay_us(1000000);

	memset(dmx_channels, 127, TWINKL_CHANNEL_COUNT);

	gpio_init();

	twinkl_init();

	os_timer_disarm(&dmx_update_timer);
	os_timer_setfn(&dmx_update_timer, (os_timer_func_t *)dmx_update, NULL);

	system_os_task(dmx_task, DMX_TASK_PRIO, dmx_task_queue, DMX_TASK_QUEUE_LENGTH);

	WIFI_Connect(wifi_ssid, wifi_password, wifiConnectCb);
}
开发者ID:LongHairedHacker,项目名称:twinkl-esp,代码行数:17,代码来源:user_main.c


示例9: user_platform_timer_start

/******************************************************************************
 * FunctionName : user_platform_timer_start
 * Description  : Processing the message about timer from the server
 * Parameters   : pbuffer -- The received data from the server

 * Returns      : none
*******************************************************************************/
void ICACHE_FLASH_ATTR
user_platform_timer_start(char *pbuffer)
{
    int str_begin = 0;
    int str_end = 0;
    uint8 i = 0;
    char *pstr_start = NULL;
    char *pstr_end = NULL;
    struct esp_platform_wait_timer_param timer_wait_param[20];
    char *pstr = NULL;

    min_wait_second  = 0;

    if ((pstr = (char *)os_strstr(pbuffer, "\"timestamp\":")) != NULL) {
        pstr_start = pstr + 13;
        pstr_end = (char *)os_strstr(pstr_start, ",");

        if (pstr != NULL) {
            os_memcpy(timestamp_str, pstr_start, pstr_end - pstr_start);
            timestamp = atoi(timestamp_str);
        }
    }

    for (i = 0 ; i < 20 ; i++) {
        if (timer_splits[i] != NULL) {
            os_free(timer_splits[i]);
            timer_splits[i] = NULL;
        }
    }

    if ((pstr_start = (char *)os_strstr(pbuffer, "\"timers\": \"")) != NULL) {
        str_begin = 11;
        str_end = indexof(pstr_start, "\"", str_begin);

        if (str_begin == str_end) {
        	os_timer_disarm(&device_timer);
            return;
        }

        char *split_buffer = (char *)os_zalloc(str_end - str_begin + 1);
        os_memcpy(split_buffer, pstr_start + str_begin, str_end - str_begin);
        uint16 count = split(split_buffer , ";" , timer_splits);
        os_free(split_buffer);
        user_platform_timer_first_start(count);
    }
}
开发者ID:Zhang-Jia,项目名称:ESP8266_LIGHT_WITH_MESH,代码行数:53,代码来源:user_esp_platform_timer.c


示例10: user_sntp_init

void ICACHE_FLASH_ATTR
user_sntp_init(void)
{
	static os_timer_t user_sntp_timer;

	// 配置sntp服务器
    sntp_setservername(0,"0.cn.pool.ntp.org");
    sntp_setservername(1,"1.cn.pool.ntp.org");
    sntp_setservername(2,"2.cn.pool.ntp.org");
    // sntp初始化
    sntp_init();

    // 定时器初始化
    os_timer_disarm(&user_sntp_timer);
    os_timer_setfn(&user_sntp_timer, sntp_timer_cb , NULL);
    os_timer_arm(&user_sntp_timer, SNTP_READ_INTERVAL, 1);
}
开发者ID:zouchuan1991,项目名称:ESP8266-Demos,代码行数:17,代码来源:user_sntp.c


示例11: user_init

void user_init(void)
{
	uart_init(BIT_RATE_115200, BIT_RATE_115200);

	//Add a process
	uart0_sendStr("Registering idle task...\r\n");
	system_os_task(procTask, procTaskPrio, procTaskQueue, procTaskQueueLen);

	//Timer example
	uart0_sendStr("Starting timer task...\r\n");
	os_timer_disarm(&some_timer);
	os_timer_setfn(&some_timer, (os_timer_func_t *)myProber, NULL);
	os_timer_arm(&some_timer, 50, 1); // Do this every 50ms
 
	uart0_sendStr("Starting idle task...\r\n");
	system_os_post(procTaskPrio, 0, 0 );
}
开发者ID:robber5,项目名称:esp8266_probereq_spammer,代码行数:17,代码来源:user_main.c


示例12: wifiJoin

int ICACHE_FLASH_ATTR wifiJoin(char *ssid, char *passwd)
{
	static os_timer_t reassTimer;

	strncpy((char*)stconf.ssid, ssid, 32);
	strncpy((char*)stconf.password, passwd, 64);
	httpd_printf("Try to connect to AP %s pw %s\n", ssid, passwd);

    connTryStatus=CONNTRY_IDLE;
    
	//Schedule disconnect/connect
	os_timer_disarm(&reassTimer);
	os_timer_setfn(&reassTimer, reassTimerCb, NULL);
	os_timer_arm(&reassTimer, 500, 0);
	
	return 0;
}
开发者ID:dbetz,项目名称:libesphttpd,代码行数:17,代码来源:cgiwifi.c


示例13: v_user_esp_platform_init

/******************************************************************************
 * FunctionName : user_esp_platform_init
 * Description  : device parame init based on espressif platform
 * Parameters   : none
 * Returns      : none
*******************************************************************************/
void ICACHE_FLASH_ATTR
v_user_esp_platform_init(void)
{
	struct station_config *config = (struct station_config *) os_zalloc(
					sizeof(struct station_config));
//	os_sprintf(config->ssid, AP_SSID);
//	os_sprintf(config->password, AP_PASSWORD);

	wifi_station_set_config(config);
	wifi_set_opmode(STATIONAP_MODE);

    if (wifi_get_opmode() != SOFTAP_MODE) {
        os_timer_disarm(&client_timer);
        os_timer_setfn(&client_timer, (os_timer_func_t *)v_user_esp_platform_check_ip, NULL);
        os_timer_arm(&client_timer, 100, 0);
    }
}
开发者ID:viclyliu,项目名称:esp_iot_sdk_v1.4.0,代码行数:23,代码来源:v_upgrade.c


示例14: dht22_cb

LOCAL void ICACHE_FLASH_ATTR dht22_cb(void *arg)
{
	static char data[256];
	static char temp_str[10];
	static char hum_str[10];
	struct dht_sensor_data* r;
	static int lastTemp, lastHum;

	os_timer_disarm(&dht22_timer);
	switch(connState)
	{
		case WIFI_CONNECTED:
			r = DHTRead();
			if(r->success)
			{
				int temp = (int)(r->temperature * 10);
				int hum = (int)(r->humidity * 10);
				os_sprintf(temp_str, "%d.%d",(int)(temp / 10), temp - ((int)(temp / 10)) * 10);
				os_sprintf(hum_str, "%d.%d",(int)(hum / 10), hum - ((int)(hum / 10)) * 10);
				os_printf("Temperature: %s *C, Humidity: %s %%\r\n", temp_str, hum_str);

				if (lastTemp != temp || lastHum != hum)
				{
					lastTemp = temp;
					lastHum = hum;
					wifi_get_ip_info(STATION_IF, &ipConfig);
					os_sprintf(data,
							"{\"mode\":\"sync\",\"messageType\":\"%s\",\"messages\":[{"
								"\"Humidity\": %s,"
								"\"Temperature\": %s"
							"}]}",
							HCP_MESSAGETYPE, hum_str, temp_str);
					hcp_send(HCP_ACCOUNT, HCP_LANDSCAPEHOST, HCP_DEVICEID, HCP_DEVICETOKEN, data, hcp_callback);
				} else {
					os_printf("No changes since last reading.\r\n");
				}
			} else {
				os_printf("Error reading temperature and humidity.\r\n");
			}
			break;
		default:
			os_printf("WiFi not connected...\r\n");
	}
	os_timer_setfn(&dht22_timer, (os_timer_func_t *)dht22_cb, (void *)0);
	os_timer_arm(&dht22_timer, DATA_SEND_DELAY, 1);
}
开发者ID:georgkreimer,项目名称:esp_hcp_temperature,代码行数:46,代码来源:user_main.c


示例15: 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)
{
	int i;

    // rom use 74880 baut_rate, here reinitialize
    uart_init(BIT_RATE_115200, BIT_RATE_115200);

	uart_tx_one_char('\r');
	__printf("NodeLua %s (With liblua %s) Copyright (C) 2014 NodeLua.org free mem=%d\n", NODELUA_RELEASE NODELUA_RELEASE_LOC, LUA_RELEASE, system_get_free_heap_size());

	// char *argv[] = {"lua", "-e", (char*)buf};
	// for(i = 0; 1; i ++)
	// {
	// 	uint16_t val = system_adc_read();
	// 	__printf("adc=%d\n", val);
	// 	luamain(sizeof(argv)/sizeof(char*), argv);
	// }

    struct station_config config;
    wifi_station_get_config(&config);
	if (wifi_get_opmode() == STATION_MODE && os_strlen(config.ssid) > 0)
	{
		os_timer_disarm(&check_sta_timer);
		os_timer_setfn(&check_sta_timer, (os_timer_func_t *)user_check_ip, 1);
		os_timer_arm(&check_sta_timer, 100, 0);
	}
	else
	{
		__printf("Please set wifi parameters to connect to an exist AP!\n");
		luainit("");
	}

	return;

// #if ESP_PLATFORM
//     user_esp_platform_init();
// #endif
//
//     user_devicefind_init();
// #ifdef SERVER_SSL_ENABLE
//     user_webserver_init(SERVER_SSL_PORT);
// #else
//     user_webserver_init(SERVER_PORT);
// #endif
}
开发者ID:Squonk42,项目名称:nodelua,代码行数:51,代码来源:user_main.c


示例16: wifi_check_ip

static void ICACHE_FLASH_ATTR wifi_check_ip(void *arg)
{
	struct ip_info ipConfig;

	os_timer_disarm(&WiFiLinker);
	wifi_get_ip_info(STATION_IF, &ipConfig);
	wifiStatus = wifi_station_get_connect_status();
	if (wifiStatus == STATION_GOT_IP && ipConfig.ip.addr != 0)
	{
		os_timer_setfn(&WiFiLinker, (os_timer_func_t *)wifi_check_ip, NULL);
		os_timer_arm(&WiFiLinker, 2000, 0);	
	}
	else
	{
		if(wifi_station_get_connect_status() == STATION_WRONG_PASSWORD)
		{
			INFO("STATION_WRONG_PASSWORD\r\n");
			wifi_station_connect();
		}
		else if(wifi_station_get_connect_status() == STATION_NO_AP_FOUND)
		{

			INFO("STATION_NO_AP_FOUND\r\n");
			wifi_station_connect();
		}
		else if(wifi_station_get_connect_status() == STATION_CONNECT_FAIL)
		{

			INFO("STATION_CONNECT_FAIL\r\n");
			wifi_station_connect();
		}
		else
		{
			//INFO("STATION_IDLE\r\n");
		}

		os_timer_setfn(&WiFiLinker, (os_timer_func_t *)wifi_check_ip, NULL);
		os_timer_arm(&WiFiLinker, 500, 0);
	}
	if(wifiStatus != lastWifiStatus){
		lastWifiStatus = wifiStatus;
		if(wifiCb)
			wifiCb(wifiStatus);
	}
}
开发者ID:hpeyerl,项目名称:ESP8266_Relay_Board,代码行数:45,代码来源:wifi.c


示例17: user_init

void ICACHE_FLASH_ATTR user_init()
{
	uart_init(BIT_RATE_115200);

	PIN_FUNC_SELECT(PIN0_MUX, PIN0_FUNC);
	GPIO_DIS_OUTPUT(PIN0);
	PIN_FUNC_SELECT(PIN1_MUX, PIN1_FUNC);
	GPIO_DIS_OUTPUT(PIN1);

	static ETSTimer timer;
	os_timer_disarm(&timer);
	os_timer_setfn(&timer, (os_timer_func_t *)on_timeout, &timer);
	os_timer_arm(&timer, 250, 1);

    hap_setConnectedCb(onMqttConnected);
    hap_setDisconnectedCb(onMqttDisconnected);
    hap_init();
}
开发者ID:andrei-tatar,项目名称:HAP.esp,代码行数:18,代码来源:user_main.c


示例18: upgrade_connect

/******************************************************************************
 * FunctionName : upgrade_connection
 * Description  : connect with a server
 * Parameters   : bin -- server number
 *                url -- the url whitch upgrade files saved
 * Returns      : none
*******************************************************************************/
LOCAL void ICACHE_FLASH_ATTR
upgrade_connect(struct upgrade_server_info *server){
	UPGRADE_DBG("upgrade_connect\n");

	pbuf = server->url;

    espconn_regist_connectcb(upgrade_conn, upgrade_connect_cb);
    espconn_regist_recvcb(upgrade_conn, upgrade_download);

    system_upgrade_init();
    system_upgrade_flag_set(UPGRADE_FLAG_START);

    espconn_connect(upgrade_conn);

    os_timer_disarm(&upgrade_connect_timer);
    os_timer_setfn(&upgrade_connect_timer, (os_timer_func_t *)upgrade_connect_timeout_cb, upgrade_conn);
    os_timer_arm(&upgrade_connect_timer, 5000, 0);
}
开发者ID:HitszChen,项目名称:intorobot-firmware,代码行数:25,代码来源:upgrade.c


示例19: drawingInit

ICACHE_FLASH_ATTR
void drawingInit(DrawingState *state) {
    state->invalid = false;
    state->automaticTempCurrentState = NULL;
    state->currentTemp = 1800;
    state->manualTemp = 1800;
    state->temperatureMode = MANUAL;
    state->weather.code = 255;
    state->weather.temp = 1800;
    state->upgrade = false;
    os_sprintf(state->weather.text, "");

    u8g_InitComFn(&(state->u8g), &u8g_dev_ssd1306_128x64_i2c, u8g_com_null_fn);

    os_timer_disarm(&(state->timer_drawing));
    os_timer_setfn(&(state->timer_drawing), drawingDrawScreen, state);
    os_timer_arm(&(state->timer_drawing), 1000, 1);
}
开发者ID:markoknez,项目名称:myThermo,代码行数:18,代码来源:drawing.c


示例20: user_init

//Init function 
void ICACHE_FLASH_ATTR
user_init()
{
    //Disarm timer
    os_timer_disarm(&some_timer);

    //Setup timer
    os_timer_setfn(&some_timer, (os_timer_func_t *)some_timerfunc, NULL);

    //Arm the timer
    //&some_timer is the pointer
    //1000 is the fire time in ms
    //0 for once and 1 for repeating
    os_timer_arm(&some_timer, 2000, 1);
    
    //Start os task
    system_os_task(user_procTask, user_procTaskPrio,user_procTaskQueue, user_procTaskQueueLen);
}
开发者ID:piersfinlayson,项目名称:esp-sdk-samples,代码行数:19,代码来源:user_main.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ os_timer_setfn函数代码示例发布时间:2022-05-30
下一篇:
C++ os_timer_arm函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap