Separating users from tasks + fixing weird ota bug
This commit is contained in:
@@ -186,6 +186,7 @@ internal httpd_handle_t start_webserver(void)
|
||||
esp_vfs_littlefs_conf_t conf = {};
|
||||
conf.base_path = "/www";
|
||||
conf.partition_label = g_Active_WWW_Partition == 0 ? "www_0" : "www_1";
|
||||
ESP_LOGI(TAG, "Mounting LittleFS partition: %s", conf.partition_label);
|
||||
conf.format_if_mount_failed = false;
|
||||
conf.dont_mount = false;
|
||||
esp_err_t ret = esp_vfs_littlefs_register(&conf);
|
||||
@@ -244,6 +245,7 @@ internal httpd_handle_t start_webserver(void)
|
||||
// Register todo list API routes
|
||||
httpd_register_uri_handler(server, &api_users_get_uri);
|
||||
httpd_register_uri_handler(server, &api_users_post_uri);
|
||||
httpd_register_uri_handler(server, &api_users_update_uri);
|
||||
httpd_register_uri_handler(server, &api_users_delete_uri);
|
||||
httpd_register_uri_handler(server, &api_tasks_upcoming_uri);
|
||||
httpd_register_uri_handler(server, &api_tasks_get_uri);
|
||||
@@ -272,14 +274,13 @@ internal httpd_handle_t start_webserver(void)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
internal void stop_webserver(httpd_handle_t server)
|
||||
internal void stop_webserver(httpd_handle_t server, uint8_t partition_index)
|
||||
{
|
||||
if (server)
|
||||
{
|
||||
httpd_stop(server);
|
||||
#ifdef CONFIG_CALENDINK_DEPLOY_WEB_PAGES
|
||||
esp_vfs_littlefs_unregister(g_Active_WWW_Partition == 0 ? "www_0"
|
||||
: "www_1");
|
||||
esp_vfs_littlefs_unregister(partition_index == 0 ? "www_0" : "www_1");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user