Fixed compilation errors with sntp

This commit is contained in:
2023-02-01 14:03:30 +01:00
parent 636ff35b52
commit f098bf2fcf

View File

@ -49,11 +49,11 @@ extern "C" {
#define esp_sntp_get_sync_interval sntp_get_sync_interval #define esp_sntp_get_sync_interval sntp_get_sync_interval
#define esp_sntp_restart sntp_restart #define esp_sntp_restart sntp_restart
#ifndef SNTP_OPMODE_POLL //#ifndef SNTP_OPMODE_POLL
#define SNTP_OPMODE_POLL ESP_SNTP_OPMODE_POLL #define SNTP_OPMODE_POLL ESP_SNTP_OPMODE_POLL
#else //#else
#warning "Defined!" //#warning "Defined!"
#endif /* SNTP_OPMODE_POLL */ //#endif /* SNTP_OPMODE_POLL */
/// SNTP time update mode /// SNTP time update mode
typedef enum { typedef enum {
@ -245,39 +245,39 @@ void esp_sntp_servermode_dhcp(bool enable);
* @brief if not build within lwip, provide translating inlines, * @brief if not build within lwip, provide translating inlines,
* that will warn about thread safety * that will warn about thread safety
*/ */
static inline __attribute__((deprecated("use esp_sntp_setoperatingmode() instead"))) inline __attribute__((deprecated("use esp_sntp_setoperatingmode() instead")))
void sntp_setoperatingmode(u8_t operating_mode) void sntp_setoperatingmode(u8_t operating_mode)
{ {
esp_sntp_setoperatingmode((esp_sntp_operatingmode_t)operating_mode); esp_sntp_setoperatingmode((esp_sntp_operatingmode_t)operating_mode);
} }
static inline __attribute__((deprecated("use esp_sntp_servermode_dhcp() instead"))) #if LWIP_DHCP_GET_NTP_SRV
inline __attribute__((deprecated("use esp_sntp_servermode_dhcp() instead")))
void sntp_servermode_dhcp(int set_servers_from_dhcp) void sntp_servermode_dhcp(int set_servers_from_dhcp)
{ {
#if LWIP_DHCP_GET_NTP_SRV
esp_sntp_servermode_dhcp(set_servers_from_dhcp); esp_sntp_servermode_dhcp(set_servers_from_dhcp);
#endif
} }
#endif
static inline __attribute__((deprecated("use esp_sntp_setservername() instead"))) inline __attribute__((deprecated("use esp_sntp_setservername() instead")))
void sntp_setservername(u8_t idx, const char *server) void sntp_setservername(u8_t idx, const char *server)
{ {
esp_sntp_setservername(idx, server); esp_sntp_setservername(idx, server);
} }
static inline __attribute__((deprecated("use esp_sntp_init() instead"))) inline __attribute__((deprecated("use esp_sntp_init() instead")))
void sntp_init(void) void sntp_init(void)
{ {
esp_sntp_init(); esp_sntp_init();
} }
static inline __attribute__((deprecated("use esp_sntp_getservername() instead"))) inline __attribute__((deprecated("use esp_sntp_getservername() instead")))
const char *sntp_getservername(u8_t idx) const char *sntp_getservername(u8_t idx)
{ {
return esp_sntp_getservername(idx); return esp_sntp_getservername(idx);
} }
static inline __attribute__((deprecated("use esp_sntp_getserver() instead"))) inline __attribute__((deprecated("use esp_sntp_getserver() instead")))
const ip_addr_t* sntp_getserver(u8_t idx) const ip_addr_t* sntp_getserver(u8_t idx)
{ {
return esp_sntp_getserver(idx); return esp_sntp_getserver(idx);