Created
February 16, 2023 15:51
-
-
Save jmpinit/90879e04d94d803f791580310191674b to your computer and use it in GitHub Desktop.
Print the stack usage of the current Zephyr thread.
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
void print_thread_stack_usage() { | |
struct k_thread* thread = k_current_get(); | |
size_t stack_space; | |
k_thread_stack_space_get(thread, &stack_space); | |
printk("Thread has %u bytes of stack space left.\n", stack_space); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment