fixed return type of user save config callbak
This commit is contained in:
parent
35b69b526b
commit
d90588ed4b
|
|
@ -42,6 +42,6 @@ void regAfterPostHandlerCustom(HTTP_IO_RESULT (*post_handler)(httpd_req_t *req,
|
||||||
//User handler for various payload types
|
//User handler for various payload types
|
||||||
void regCustomPayloadTypeHandler(sys_error_code (*payload_handler)(data_message_t *MSG));
|
void regCustomPayloadTypeHandler(sys_error_code (*payload_handler)(data_message_t *MSG));
|
||||||
//User handler for save App configuration
|
//User handler for save App configuration
|
||||||
void regCustomSaveConf(esp_err_t (custom_saveconf)(void));
|
void regCustomSaveConf(void (*custom_saveconf)(void));
|
||||||
|
|
||||||
#endif /* COMPONENTS_WEBGUIAPP_INCLUDE_USERCALLBACKS_H_ */
|
#endif /* COMPONENTS_WEBGUIAPP_INCLUDE_USERCALLBACKS_H_ */
|
||||||
|
|
|
||||||
15
src/SNTP.c
15
src/SNTP.c
|
|
@ -37,7 +37,6 @@ void regTimeSyncCallback(void (*time_sync)(struct timeval *tv))
|
||||||
|
|
||||||
static void initialize_sntp(void);
|
static void initialize_sntp(void);
|
||||||
|
|
||||||
|
|
||||||
void SecondTickSystem(void *arg);
|
void SecondTickSystem(void *arg);
|
||||||
esp_timer_handle_t system_seconds_timer;
|
esp_timer_handle_t system_seconds_timer;
|
||||||
const esp_timer_create_args_t system_seconds_timer_args = {
|
const esp_timer_create_args_t system_seconds_timer_args = {
|
||||||
|
|
@ -67,13 +66,27 @@ static void time_sync_notification_cb(struct timeval *tv)
|
||||||
|
|
||||||
static void initialize_sntp(void)
|
static void initialize_sntp(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#if ESP_IDF_VERSION_MAJOR >= 5
|
||||||
|
esp_sntp_setoperatingmode(SNTP_OPMODE_POLL);
|
||||||
|
esp_sntp_setservername(0, GetSysConf()->sntpClient.SntpServerAdr);
|
||||||
|
esp_sntp_setservername(1, GetSysConf()->sntpClient.SntpServerAdr);
|
||||||
|
esp_sntp_setservername(2, GetSysConf()->sntpClient.SntpServerAdr);
|
||||||
|
#else
|
||||||
sntp_setoperatingmode(SNTP_OPMODE_POLL);
|
sntp_setoperatingmode(SNTP_OPMODE_POLL);
|
||||||
sntp_setservername(0, GetSysConf()->sntpClient.SntpServerAdr);
|
sntp_setservername(0, GetSysConf()->sntpClient.SntpServerAdr);
|
||||||
sntp_setservername(1, GetSysConf()->sntpClient.SntpServerAdr);
|
sntp_setservername(1, GetSysConf()->sntpClient.SntpServerAdr);
|
||||||
sntp_setservername(2, GetSysConf()->sntpClient.SntpServerAdr);
|
sntp_setservername(2, GetSysConf()->sntpClient.SntpServerAdr);
|
||||||
|
#endif
|
||||||
|
|
||||||
sntp_set_sync_interval(6 * 3600 * 1000);
|
sntp_set_sync_interval(6 * 3600 * 1000);
|
||||||
sntp_set_time_sync_notification_cb(time_sync_notification_cb);
|
sntp_set_time_sync_notification_cb(time_sync_notification_cb);
|
||||||
|
|
||||||
|
#if ESP_IDF_VERSION_MAJOR >= 5
|
||||||
|
esp_sntp_init();
|
||||||
|
#else
|
||||||
sntp_init();
|
sntp_init();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void StartTimeGet(void)
|
void StartTimeGet(void)
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ void regCustomPayloadTypeHandler(sys_error_code (*payload_handler)(data_message_
|
||||||
{
|
{
|
||||||
CustomPayloadTypeHandler = payload_handler;
|
CustomPayloadTypeHandler = payload_handler;
|
||||||
}
|
}
|
||||||
void regCustomSaveConf(esp_err_t (custom_saveconf)(void))
|
void regCustomSaveConf(void (*custom_saveconf)(void))
|
||||||
{
|
{
|
||||||
CustomSaveConf = custom_saveconf;
|
CustomSaveConf = custom_saveconf;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user