How do I preserve stack space with good code in an RTOS

I'm learning to code in C for a small microcontroller with limited RAM and an RTOS. I try to break my code into short functions, but each function call adds more stack memory usage. Any tips for keeping the code organized and readable without using too much memory?
2 Replies
Chimmuanya Okere
When you are breaking your code into small functions, try to use static variables, pick efficient data structures, and watch for memory-friendly variable types. Avoid irrelevant recursion, and use your RTOS wisely for memory management. Keep it very simple
Marvee Amasi
Marvee Amasi3mo ago
Thanks , talking about memory-friendly variable types , what could they be