Statistics: Posted by a693098385 — Fri Jul 14, 2017 3:56 pm
Statistics: Posted by Her Mary — Thu Jul 13, 2017 6:06 pm
Code:
fpm_wakup_cb()
{
wifi_fpm_close();//关闭休眠
wifi_set_opmode(0x03);//设置路由模式
wifi_station_connect();//连接路由
}
Code:
user_func()
{
wifi_station_disconnect();//关闭ap
wifi_set_opmode(0x00);//wifi类型
wifi_fpm_open();//开启强制休眠
wifi_fpm_set_sleep_type(LIGHT_SLEEP_T);//休眠类型
PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO5_U, FUNC_GPIO5);
GPIO_OUTPUT_SET(GPIO_ID_PIN(5), 0);
wifi_enable_gpio_wakeup(5, GPIO_PIN_INTR_HILEVEL);
wifi_fpm_set_wakeup_cb(fpm_wakup_cb);//返回函数
wifi_fpm_do_sleep(0xFFFFFFF);//休眠时间永久
}
Code:
mode : null
fpm open,type:1 0
force slp enable,type: 1
fpm close 3
Code:
void ICACHE_FLASH_ATTR GPIO_INTERRUPT(void *arg)
{
uint32 gpio_status=0;
gpio_status = GPIO_REG_READ(GPIO_STATUS_ADDRESS);
ETS_GPIO_INTR_DISABLE();
GPIO_REG_WRITE(GPIO_STATUS_W1TC_ADDRESS, gpio_status);
if(gpio_status & BIT(13)){
os_printf("aaaaaaaaaaaaaaaaaaaaaaaaaa");
user_func();
}
os_delay_us(300);
ETS_GPIO_INTR_ENABLE();
}
Statistics: Posted by a693098385 — Wed Jul 12, 2017 1:25 pm