-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Klipper params being non-blocking
- Loading branch information
1 parent
f8ed3af
commit 0992f46
Showing
9 changed files
with
76 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
#pragma once | ||
|
||
void data_loop(); | ||
void data_setup(); | ||
|
||
void freeze_request_thread(); | ||
void unfreeze_request_thread(); | ||
void data_setup(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include "semaphore.h" | ||
#include <UrlEncode.h> | ||
#include <esp_task_wdt.h> | ||
|
||
SemaphoreHandle_t freezeRenderThreadSemaphore, freezeRequestThreadSemaphore; | ||
|
||
void semaphore_init(){ | ||
freezeRenderThreadSemaphore = xSemaphoreCreateMutex(); | ||
freezeRequestThreadSemaphore = xSemaphoreCreateMutex(); | ||
xSemaphoreGive(freezeRenderThreadSemaphore); | ||
xSemaphoreGive(freezeRequestThreadSemaphore); | ||
} | ||
|
||
void freeze_request_thread(){ | ||
xSemaphoreTake(freezeRequestThreadSemaphore, portMAX_DELAY); | ||
} | ||
|
||
void unfreeze_request_thread(){ | ||
xSemaphoreGive(freezeRequestThreadSemaphore); | ||
} | ||
|
||
void freeze_render_thread(){ | ||
xSemaphoreTake(freezeRenderThreadSemaphore, portMAX_DELAY); | ||
} | ||
|
||
void unfreeze_render_thread(){ | ||
xSemaphoreGive(freezeRenderThreadSemaphore); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#pragma once | ||
|
||
void semaphore_init(); | ||
|
||
void freeze_request_thread(); | ||
void unfreeze_request_thread(); | ||
|
||
// Don't use unless you want trouble | ||
void freeze_render_thread(); | ||
// Don't use unless you want trouble | ||
void unfreeze_render_thread(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters