ESP8266: SNTP config only runs when enabled

pull/12300/head
Michal Paszta 2020-03-24 14:38:53 +02:00
parent 8175e32717
commit cf2ba1d37d
2 changed files with 3 additions and 1 deletions

View File

@ -715,6 +715,7 @@ nsapi_error_t ESP8266Interface::_init(void)
if (!_esp.startup(ESP8266::WIFIMODE_STATION)) { if (!_esp.startup(ESP8266::WIFIMODE_STATION)) {
return NSAPI_ERROR_DEVICE_ERROR; return NSAPI_ERROR_DEVICE_ERROR;
} }
#if MBED_CONF_ESP8266_SNTP_ENABLE
if (!_esp.set_sntp_config(MBED_CONF_ESP8266_SNTP_ENABLE, if (!_esp.set_sntp_config(MBED_CONF_ESP8266_SNTP_ENABLE,
MBED_CONF_ESP8266_SNTP_TIMEZONE, MBED_CONF_ESP8266_SNTP_TIMEZONE,
MBED_CONF_ESP8266_SNTP_SERVER0, MBED_CONF_ESP8266_SNTP_SERVER0,
@ -722,6 +723,7 @@ nsapi_error_t ESP8266Interface::_init(void)
MBED_CONF_ESP8266_SNTP_SERVER2)) { MBED_CONF_ESP8266_SNTP_SERVER2)) {
return NSAPI_ERROR_DEVICE_ERROR; return NSAPI_ERROR_DEVICE_ERROR;
} }
#endif
_initialized = true; _initialized = true;
} }
return NSAPI_ERROR_OK; return NSAPI_ERROR_OK;

View File

@ -71,7 +71,7 @@
"value": false "value": false
}, },
"sntp-enable": { "sntp-enable": {
"help": "Enable SNTP. This allows application to use get_sntp_time()", "help": "Enable SNTP. This allows application to use get_sntp_time(). Only available from ESP8266 AT v1.5. This driver supports v1.7 and higher.",
"value": false "value": false
}, },
"sntp-timezone": { "sntp-timezone": {