/****************************************************************************** * FunctionName : user_link_led_output * Description : led flash mode * Parameters : mode, on/off/xhz * Returns : none *******************************************************************************/ void user_link_led_output(uint8 mode) { switch (mode) { case LED_OFF: os_timer_disarm(&link_led_timer); GPIO_OUTPUT_SET(GPIO_ID_PIN(PLUG_LINK_LED_IO_NUM), 1); break; case LED_ON: os_timer_disarm(&link_led_timer); GPIO_OUTPUT_SET(GPIO_ID_PIN(PLUG_LINK_LED_IO_NUM), 0); break; case LED_1HZ: user_link_led_timer_init(1000); break; case LED_5HZ: user_link_led_timer_init(200); break; case LED_20HZ: user_link_led_timer_init(50); break; default: printf("ERROR:LED MODE WRONG!\n"); break; } }
/****************************************************************************** * FunctionName : user_humiture_long_press * Description : humiture key's function, needed to be installed * Parameters : none * Returns : none *******************************************************************************/ LOCAL void ICACHE_FLASH_ATTR user_sensor_long_press(void) { os_printf(" LVZAINA ===> SmartConfig start! \n"); uint32 gpio_status; gpio_status = GPIO_REG_READ(GPIO_STATUS_ADDRESS); //clear interrupt status GPIO_REG_WRITE(GPIO_STATUS_W1TC_ADDRESS, gpio_status); user_link_led_timer_init(); smartconfig_stop(); smartconfig_start(smartconfig_done); os_printf(" LVZAINA ===> SmartConfig end! \n"); }