twice:
What do you mean by "Save reset cause in a way that the application can read it."?
One example I use it for is to avoid a loud audio "pop" on my speakers when I power up the Arduino with an audio DAC card. Otherwise I would also get a audio "pop" when just pressing the reset button. So I want to ramp up the audio to mid level only during power up and not just a reset.
void setup() {
// Get reset flags
resetFlagsInit();
// ramp up to mid audio level to avoid pop, unless from reset.
mcpDacInit();
if (resetFlags & _BV(PORF)) {
for(int i=0; i<=2048; i++) {
mcpDacSend(i);
}
}
}