Created
August 8, 2025 21:55
-
-
Save codebrainz/de3a3b89ec648eeb2ff894ea941ffb4f to your computer and use it in GitHub Desktop.
Redacted delay
This file contains hidden or 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
| diff --git a/kernel/async.c b/kernel/async.c | |
| index 8b37a2b..b113ab0 100644 | |
| --- a/kernel/async.c | |
| +++ b/kernel/async.c | |
| @@ -17,7 +17,7 @@ void delay(uint32_t ms) { | |
| } | |
| } | |
| -#define WAIT_COND (*reg & expected_value) == expected_value | |
| +#define WAIT_COND (((*reg) & (expected_value))) == (expected_value) | |
| #define WAIT_CHECK (match > 0) ^ condition | |
| bool wait(uint32_t *reg, uint32_t expected_value, bool match, uint32_t timeout){ | |
| @@ -25,7 +25,7 @@ bool wait(uint32_t *reg, uint32_t expected_value, bool match, uint32_t timeout){ | |
| while (WAIT_CHECK) { | |
| if (timeout != 0){ | |
| timeout--; | |
| - delay(1); | |
| + delay(0); | |
| } | |
| condition = WAIT_COND; | |
| if (timeout == 0) | |
| @@ -33,4 +33,4 @@ bool wait(uint32_t *reg, uint32_t expected_value, bool match, uint32_t timeout){ | |
| } | |
| return true; | |
| -} | |
| \ No newline at end of file | |
| +} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment