Skip to content

Commit

Permalink
Lower data fetch task priority
Browse files Browse the repository at this point in the history
  • Loading branch information
suchmememanyskill committed Jan 7, 2024
1 parent a7acd49 commit 48466cf
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions CYD-Klipper/src/core/data_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(){
Expand Down Expand Up @@ -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();
}
}

Expand All @@ -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);
}

0 comments on commit 48466cf

Please sign in to comment.