Hi Again Friends?
I have been told i have to use .noninit attribute when declaring a certain variable
of which I won't want to be initialized as result of Reset such as WDT.
Actually if i remember well RAM isn't cleared as result of Reset such as WDT but This rather have something to do with GCC itself at start code where a piece of code is run before the "main" function Although I don't remember deep into this now ':oops:'
Well the question was simple. Depending on my project's structure and OS, i have quite few time-out variables (which are being decremented or incremented) to keep in track of certain events. These variables have to remain active (without being initialized) for quite few seconds unless otherwise they are initialized manually somewhere within the code!
The Problem was then that there is a WDT which is reseting an MCU in about every 500ms! which clears means none of these time- out variable will ever make it as they took far longer that the reseting time. I also think that many resets from WDT reset will probably create some delaying offset on these time- out variable values but again this is far better than starting to zero ':twisted:'
I have been reading on quite few forums online but not all quite answered my actual question with example. So briefly i needed a quick help and maybe a snippet or piece of code showing how to simply declare the .noninit variable that would warn the GCC to not initialize that particular variable at the start up.
Many Thanks Again.