Пример #1
0
/******************************************************************************
 * FunctionName : user_init
 * Description  : entry of user application, init user function here
 * Parameters   : none
 * Returns	    : none
 *******************************************************************************/
void ICACHE_FLASH_ATTR user_init(void) {
	system_init_done_cb(user_init_done);
	
	// UART Devices
	mod_rfid_init();
	mod_finger_init();
	mod_emtr_init();
	devices_init();
	
	debug("\n\nSDK version: %s\n", system_get_sdk_version());
	debug("Firmware: %s\n", config_firmware_bin());
	memory_info();
	
	user_config_init();
	user_config_load();
#if SSL_ENABLE
	user_config_load_private_key();
	user_config_load_certificate();
#endif
	
	user_events_init();
	
	// Scan
	webserver_register_handler_callback(DEVICES_URL,   devices_handler);
	webserver_register_handler_callback(WIFI_SCAN_URL, wifi_scan_handler);
	
	// Native Devices
	user_button_init();
	user_relay_init();
	user_adc_init();
	
	// I2C Devices
	i2c_master_gpio_init();
	mod_rgb_init();
	mod_tc_mk2_init();
	mod_io2_init();
	mod_irda_init();
	
	// SPI Devices
	mod_led_8x8_rgb_init();
	
	webserver_init();
}
Пример #2
0
/******************************************************************************
 * FunctionName : user_init
 * Description  : entry of user application, init user function here
 * Parameters   : none
 * Returns	    : none
 *******************************************************************************/
void ICACHE_FLASH_ATTR user_init(void) {
	system_init_done_cb(user_init_done);
	
//	wifi_set_phy_mode(PHY_MODE_11N);
//	wifi_set_sleep_type(MODEM_SLEEP_T);
	
#if UART0_SWAP
	stdout_disable();
	system_uart_swap();
#endif
#if UART1_ENABLE
	stdout_init(UART1);
#endif

	// UART Devices
#if DEVICE == PLUG
	user_plug_init();
#endif
#if DEVICE == SWITCH1
	user_switch1_init();
#endif
#if DEVICE == SWITCH2
	user_switch2_init();
#endif
#if MOD_RFID_ENABLE
	mod_rfid_init();
#endif
#if MOD_FINGER_ENABLE
	mod_finger_init();
#endif
#if MOD_EMTR_ENABLE
	mod_emtr_init();
#endif
	devices_init();
	
	debug("\n\nSDK version: %s\n", system_get_sdk_version());
	debug("Firmware: %s\n", config_firmware_bin());
	memory_info();
	
	user_config_init();
	user_config_load();
#if SSL_ENABLE
	user_config_load_private_key();
	user_config_load_certificate();
#endif
	
	user_events_init();
	
	// Scan
	webserver_register_handler_callback(DEVICES_URL,   devices_handler);
	webserver_register_handler_callback(WIFI_SCAN_URL, wifi_scan_handler);
	
	// Native Devices
#if BUTTON_ENABLE
	user_button_init();
#endif
#if RELAY_ENABLE
	user_relay_init();
#endif
#if ADC_ENABLE
	user_adc_init();
#endif
#if BATTERY_ENABLE
	user_battery_init();
#endif
	
#if I2C_ENABLE	
	// I2C Devices
	i2c_master_gpio_init();
#if MOD_RGB_ENABLE
	mod_rgb_init();
#endif
#if MOD_TC_MK2_ENABLE
	mod_tc_mk2_init();
#endif
#if MOD_IO2_ENABLE
	mod_io2_init();
#endif
#if MOD_IRDA_ENABLE
	mod_irda_init();
#endif
#if DEVICE == DIMMER
	user_dimmer_init();
#endif
#endif
	
	// SPI Devices
#if MOD_LED_8x8_RGB_ENABLE
	mod_led_8x8_rgb_init();
#endif
#if DEVICE == BADGE
	badge_init();
#endif
	
	key_init();
	webserver_init();
}
Пример #3
0
/******************************************************************************
 * FunctionName : user_init
 * Description  : entry of user application, init user function here
 * Parameters   : none
 * Returns	    : none
 *******************************************************************************/
void ICACHE_FLASH_ATTR user_init(void) {
    system_init_done_cb(user_init_done);

    // UART Devices
#if MOD_RFID_ENABLE
    mod_rfid_init();
#endif
#if MOD_FINGER_ENABLE
    mod_finger_init();
#endif
#if MOD_EMTR_ENABLE
    mod_emtr_init();
#endif
    devices_init();

    debug("\n\nSDK version: %s\n", system_get_sdk_version());
    debug("Firmware: %s\n", config_firmware_bin());
    memory_info();

    user_config_init();
    user_config_load();
#if SSL_ENABLE
    user_config_load_private_key();
    user_config_load_certificate();
#endif

    user_events_init();

    // Scan
    webserver_register_handler_callback(DEVICES_URL,   devices_handler);
    webserver_register_handler_callback(WIFI_SCAN_URL, wifi_scan_handler);

    // Native Devices
#if BUTTON_ENABLE
    user_button_init();
#endif
#if RELAY_ENABLE
    user_relay_init();
#endif
#if ADC_ENABLE
    user_adc_init();
#endif
#if BATTERY_ENABLE
    user_battery_init();
#endif

    // I2C Devices
    i2c_master_gpio_init();
#if MOD_RGB_ENABLE
    mod_rgb_init();
#endif
#if MOD_TC_MK2_ENABLE
    mod_tc_mk2_init();
#endif
#if MOD_IO2_ENABLE
    mod_io2_init();
#endif
#if MOD_IRDA_ENABLE
    mod_irda_init();
#endif

    // SPI Devices
#if MOD_LED_8x8_RGB_ENABLE
    mod_led_8x8_rgb_init();
#endif

    key_init();
    webserver_init();
}