fixed return type of user save config callbak

This commit is contained in:
Bogdan Pilyugin 2023-09-08 15:22:32 +02:00
parent 35b69b526b
commit d90588ed4b
3 changed files with 36 additions and 23 deletions

View File

@ -42,6 +42,6 @@ void regAfterPostHandlerCustom(HTTP_IO_RESULT (*post_handler)(httpd_req_t *req,
//User handler for various payload types
void regCustomPayloadTypeHandler(sys_error_code (*payload_handler)(data_message_t *MSG));
//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_ */

View File

@ -37,7 +37,6 @@ void regTimeSyncCallback(void (*time_sync)(struct timeval *tv))
static void initialize_sntp(void);
void SecondTickSystem(void *arg);
esp_timer_handle_t system_seconds_timer;
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)
{
#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_setservername(0, GetSysConf()->sntpClient.SntpServerAdr);
sntp_setservername(1, GetSysConf()->sntpClient.SntpServerAdr);
sntp_setservername(2, GetSysConf()->sntpClient.SntpServerAdr);
#endif
sntp_set_sync_interval(6 * 3600 * 1000);
sntp_set_time_sync_notification_cb(time_sync_notification_cb);
#if ESP_IDF_VERSION_MAJOR >= 5
esp_sntp_init();
#else
sntp_init();
#endif
}
void StartTimeGet(void)

View File

@ -54,7 +54,7 @@ void regCustomPayloadTypeHandler(sys_error_code (*payload_handler)(data_message_
{
CustomPayloadTypeHandler = payload_handler;
}
void regCustomSaveConf(esp_err_t (custom_saveconf)(void))
void regCustomSaveConf(void (*custom_saveconf)(void))
{
CustomSaveConf = custom_saveconf;
}