I have been learning about the AVR sleep modes as I would like to start using them in my future projects. I think I have understood the most of it except some specific details below
Under Power Reduction Register (PRR), it mentions that using this to turn off the clock to a peripheral freezes the peripheral in it's current state with the I/O registers becoming inaccessible. Also the resources used by this peripheral would remain unoccupied. So its suggested to disable to peripheral before stopping the clock to it.
Under AVR-gcc documention of , they have provided the atomic instructions (sleep_enable, sleep_cpu and sleep_disable) besides the all automatic sleep_mode macro. The reason given is that sleep_mode might case race condition in some cases.
Can someone please explain the above 2 points in more detail.