add an example about how to use Kconfig file
Signed-off-by: Nicola Lunghi <nicola.lunghi@jci.com>
This commit is contained in:
parent
67f39545cc
commit
0c060e92e9
|
@ -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
|
|
@ -22,8 +22,8 @@ void app_main(void)
|
||||||
ESP_ERROR_CHECK( esp_wifi_set_mode(WIFI_MODE_STA) );
|
ESP_ERROR_CHECK( esp_wifi_set_mode(WIFI_MODE_STA) );
|
||||||
wifi_config_t sta_config = {
|
wifi_config_t sta_config = {
|
||||||
.sta = {
|
.sta = {
|
||||||
.ssid = "access_point_name",
|
.ssid = CONFIG_ESP_WIFI_SSID,
|
||||||
.password = "password",
|
.password = CONFIG_ESP_WIFI_PASSWORD,
|
||||||
.bssid_set = false
|
.bssid_set = false
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue