only:reusing smarter method, removing irrelevant guards

This commit is contained in:
rusefillc 2023-06-25 02:04:17 -04:00
parent 54d756ce80
commit 638b21f8dc
1 changed files with 1 additions and 5 deletions

View File

@ -143,14 +143,10 @@ static void sayHello() {
}
void validateStack(const char*msg, ObdCode code, int desiredStackUnusedSize) {
#if CH_DBG_THREADS_PROFILING && CH_DBG_FILL_THREADS
int unusedStack = CountFreeStackSpace(chThdGetSelfX()->wabase);
int unusedStack = getCurrentRemainingStack();
if (unusedStack < desiredStackUnusedSize) {
warning(code, "Stack low on %s: %d", msg, unusedStack);
}
#else
(void)msg; (void)code; (void)desiredStackUnusedSize;
#endif
}
#if CH_DBG_THREADS_PROFILING && CH_DBG_FILL_THREADS