mirror of https://github.com/ARMmbed/mbed-os.git
ESP8266: SNTP config only runs when enabled
parent
8175e32717
commit
cf2ba1d37d
|
@ -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;
|
||||||
|
|
|
@ -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": {
|
||||||
|
|
Loading…
Reference in New Issue