mirror of
https://github.com/suchmememanyskill/CYD-Klipper.git
synced 2026-11-15 13:35:52 +00:00
Lock UI thread when setting state to offline, fix #86
This commit is contained in:
1 parent
dce6f70ef9
commit
356c78ee5f
1 file changed
+3
-1
@@ -305,16 +305,18 @@ void fetch_printer_data()
|
||||
}
|
||||
else
|
||||
{
|
||||
unfreeze_request_thread();
|
||||
klipper_request_consecutive_fail_count++;
|
||||
|
||||
if (klipper_request_consecutive_fail_count == 5)
|
||||
{
|
||||
freeze_render_thread();
|
||||
printer.state = PRINTER_STATE_OFFLINE;
|
||||
lv_msg_send(DATA_PRINTER_STATE, &printer);
|
||||
unfreeze_render_thread();
|
||||
}
|
||||
|
||||
Serial.printf("Failed to fetch printer data: %d\n", httpCode);
|
||||
unfreeze_request_thread();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user