By following the example code from optiboot
here I was able to save a copy of MCUSR to use in my program. A couple of things I noticed:
- As you mentioned earlier, the bootloader uses the watchdog during reset. So an external reset (like with the reset pushbutton) is appearing as a WDT reset
- The flags are not mutually exclusive. On a power on reset, both the power flag and brown out flag get set (I'm assuming just based on the voltage rise time during start up). However, it seems like the case where both are set really just means that its a power on.
For my purposes this level of distinction is good enough, I think this is the closest I am able to get without going back to editing the bootloader.
And maybe a status should be added to the top of this thread. (FWIW I don't think its a bug.)
I agree with this--the code/bootloader is operating exactly as it's defined to. It's more just a consequence of the bootloaders operation. Not exactly sure what you mean by adding a status though...I'm happy to add one if you let me know what to do