diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 49f7829..0bea1be 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -33,6 +33,8 @@ target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE SNTP_STARTUP_DELAY=0 SNTP_SET_SYSTEM_TIME=set_system_time SNTP_UPDATE_DELAY=86400 + WLAN_SSID="" + WLAN_PW="" ) set_target_properties(${CMAKE_PROJECT_NAME} diff --git a/src/utils.cpp b/src/utils.cpp index ae50201..fb31dfd 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -160,22 +160,22 @@ int wifi_setup(uint32_t country, const string &ssid, const string &pw, bool firs } void wifi_enable() { - const string ssid{"Apis cerana"}; - const string pw{"2JkJEh2vptVT"}; const uint32_t country{CYW43_COUNTRY_GERMANY}; bool firstTry = true; int res = -1; do { if (firstTry) { - res = wifi_setup(country, ssid, pw, true); + res = wifi_setup(country, WLAN_SSID, WLAN_PW, + true); // WLAN_SSID and WLAN_PW come from CMakeLists.txt firstTry = false; } else { #ifdef DEBUG printf("Setting up connection failed. Trying again after 5 sec...\n"); #endif sleep_ms(5000); - res = wifi_setup(country, ssid, pw, false); + res = wifi_setup(country, WLAN_SSID, WLAN_PW, + false); // WLAN_SSID and WLAN_PW come from CMakeLists.txt } } while (res != CYW43_LINK_UP);