Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

1
  • 1
    Nice explanation especially about the data race risk which I hadn't thought about. When I use sleep mode, with wakeup on either external or pin change interrupt, I usually, if compatible with the application, (a) have an empty interrupt service routine and (b) don't detach the interrupt which is anyway attached in setup(). The sleep_disable() command immediately follows the sleep_cpu() command then any other code to respond to the wake up. Commented Jan 21, 2023 at 5:08