/* * SPDX-License-Identifier: Apache-2.0 */ #include "esp_log.h" #include "nvs_flash.h" #include "net.h" #include "patterns.h" #include "web.h" static const char *TAG = "example"; extern "C" void app_main(void) { // NVS holds the saved Wi-Fi client credentials esp_err_t err = nvs_flash_init(); if (err == ESP_ERR_NVS_NO_FREE_PAGES || err == ESP_ERR_NVS_NEW_VERSION_FOUND) { ESP_ERROR_CHECK(nvs_flash_erase()); err = nvs_flash_init(); } ESP_ERROR_CHECK(err); patterns_start(); ESP_ERROR_CHECK(net_start()); ESP_ERROR_CHECK(web_start()); char ssid[16]; net_ap_ssid(ssid, sizeof(ssid)); ESP_LOGI(TAG, "Ready: join Wi-Fi %s and open http://192.168.4.1/, or http://led.local/ on your network", ssid); }