lwip: menuconfig option to enable ntp servers option request via DHCP

This could be toggled on/off, off is the default.
SNTP debug option. Example update for ntp via DHCP

Signed-off-by: Emil Muratov <gpm@hotplug.ru>
This commit is contained in:
Emil Muratov
2021-07-28 19:45:45 +03:00
parent 80810971c8
commit 34be62665c
3 changed files with 38 additions and 3 deletions

View File

@@ -122,6 +122,14 @@ static void obtain_time(void)
ESP_ERROR_CHECK(esp_netif_init());
ESP_ERROR_CHECK( esp_event_loop_create_default() );
/**
* NTP server address could be aquired via DHCP,
* see LWIP_DHCP_GET_NTP_SRV menuconfig option
*/
#ifdef LWIP_DHCP_GET_NTP_SRV
sntp_servermode_dhcp(1);
#endif
/* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.
* Read "Establishing Wi-Fi or Ethernet Connection" section in
* examples/protocols/README.md for more information about this function.