Skip to content

Commit 4cc582c

Browse files
ESP8266: SNTP config only runs when enabled
1 parent 8175e32 commit 4cc582c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

components/wifi/esp8266-driver/ESP8266Interface.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,13 +715,15 @@ nsapi_error_t ESP8266Interface::_init(void)
715715
if (!_esp.startup(ESP8266::WIFIMODE_STATION)) {
716716
return NSAPI_ERROR_DEVICE_ERROR;
717717
}
718+
#if MBED_CONF_ESP8266_SNTP_ENABLE
718719
if (!_esp.set_sntp_config(MBED_CONF_ESP8266_SNTP_ENABLE,
719720
MBED_CONF_ESP8266_SNTP_TIMEZONE,
720721
MBED_CONF_ESP8266_SNTP_SERVER0,
721722
MBED_CONF_ESP8266_SNTP_SERVER1,
722723
MBED_CONF_ESP8266_SNTP_SERVER2)) {
723724
return NSAPI_ERROR_DEVICE_ERROR;
724725
}
726+
#endif
725727
_initialized = true;
726728
}
727729
return NSAPI_ERROR_OK;

components/wifi/esp8266-driver/mbed_lib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"value": false
7272
},
7373
"sntp-enable": {
74-
"help": "Enable SNTP. This allows application to use get_sntp_time()",
74+
"help": "Enable SNTP. This allows application to use get_sntp_time(). Only available from ESP8266 AT v1.5.",
7575
"value": false
7676
},
7777
"sntp-timezone": {

0 commit comments

Comments
 (0)