From 48466cfb4401c268ae58afb09f5853b3d1dbf2bf Mon Sep 17 00:00:00 2001 From: suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com> Date: Sun, 7 Jan 2024 21:07:19 +0100 Subject: [PATCH] Lower data fetch task priority --- CYD-Klipper/src/core/data_setup.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/CYD-Klipper/src/core/data_setup.cpp b/CYD-Klipper/src/core/data_setup.cpp index 28ba10c..6241f60 100644 --- a/CYD-Klipper/src/core/data_setup.cpp +++ b/CYD-Klipper/src/core/data_setup.cpp @@ -15,7 +15,6 @@ Printer printer = {0}; int klipper_request_consecutive_fail_count = 0; char filename_buff[512] = {0}; SemaphoreHandle_t freezeRenderThreadSemaphore, freezeRequestThreadSemaphore; -long last_data_update = 0; const long data_update_interval = 800; void semaphore_init(){ @@ -212,12 +211,8 @@ void data_loop() void data_loop_background(void * param){ while (true){ - delay(100); - if (millis() - last_data_update < data_update_interval) - continue; - + delay(data_update_interval); fetch_printer_data(); - last_data_update = millis(); } } @@ -230,5 +225,5 @@ void data_setup() fetch_printer_data(); macros_query_setup(); freeze_render_thread(); - xTaskCreatePinnedToCore(data_loop_background, "data_loop_background", 5000, NULL, 1, &background_loop, 0); + xTaskCreatePinnedToCore(data_loop_background, "data_loop_background", 5000, NULL, 0, &background_loop, 0); }