add an example about how to use Kconfig file

Signed-off-by: Nicola Lunghi <nicola.lunghi@jci.com>
This commit is contained in:
Nicola Lunghi 2018-05-08 16:26:35 +01:00 committed by Mahavir Jain
parent 67f39545cc
commit 0c060e92e9
2 changed files with 16 additions and 2 deletions

14
main/Kconfig.projbuild Normal file
View File

@ -0,0 +1,14 @@
# put here your custom config value
menu "Example Configuration"
config ESP_WIFI_SSID
string "WiFi SSID"
default "myssid"
help
SSID (network name) for the example to connect to.
config ESP_WIFI_PASSWORD
string "WiFi Password"
default "mypassword"
help
WiFi password (WPA or WPA2) for the example to use.
endmenu

View File

@ -22,8 +22,8 @@ void app_main(void)
ESP_ERROR_CHECK( esp_wifi_set_mode(WIFI_MODE_STA) );
wifi_config_t sta_config = {
.sta = {
.ssid = "access_point_name",
.password = "password",
.ssid = CONFIG_ESP_WIFI_SSID,
.password = CONFIG_ESP_WIFI_PASSWORD,
.bssid_set = false
}
};