I'm looking for something related to sleep modes.
I'd like to know the list of Arduino commands that I can execute just prior to a sleep, to know (guarantee) that all features, devices, and pins I've used in the program get return to the default / idle / off state.
Why? I have built a battery powered application that has a strange power consumption. I have built a target board, so now the chip is not socketed onto Arduino board, but rather my board. When I apply power, the program starts, which is to setup both external interrupt buttons to input w/ pullup, then sleep. The idle consumption in this state is 0.11 mA. It stays this way until one of the interrupt buttons (I use both) is pressed, then it goes into action and transmits over a radio, spiking up to 45mA when doing that, then I sleep the radio (it's active low), and change all the atmega pins to inputs no pullup, except for pullups on the interrupt buttons... Then I call a reset routine (jump to address 0). Now, power consumption is 0.29mA, and it doesn't drop below that. The cycle can be repeated of pushing buttons, spike, settle... but never again down to 0.11mA. Unless I remove power from the board, and reapply... then it starts at 0.11mA
So, I'd like to run all commands necessary to force the chip into the state it was in when power was first applied. I'll run these commands as the last step before I call the reset routine - that promptly leads to a sleep.
Advice?