weixin_39942108
weixin_39942108
2020-12-06 00:19

Add sleep handler to optimize low-power sleep

Sleep handler is invoked right before entering the sleep function, as well a just after the sleep completes. Applications can use this handler to turn off peripherals or put pins into a best possible low power state according to the concrete hardware design.

该提问来源于开源项目:mysensors/MySensors

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

4条回答

  • weixin_40002009 weixin_40002009 5月前

    The current AVR GCC is v7.3.0 (Arduino Boards v1.8.2) - you can use a weak function definition instead of MY_SLEEP_HANDLER.

    点赞 评论 复制链接分享
  • weixin_39942108 weixin_39942108 5月前

    The current AVR GCC is v7.3.0 (Arduino Boards v1.8.2) - you can use a weak function definition instead of MY_SLEEP_HANDLER.

    I followed the same approach as MY_INDICATION_HANDLER, which is somewhat more explicitly visible for the developers, but if weak functions are preferred now I can revise.

    点赞 评论 复制链接分享
  • weixin_40002009 weixin_40002009 5月前

    I totally agree, please go ahead with your implementation. We may reconsider that in a later update.

    点赞 评论 复制链接分享
  • weixin_39942108 weixin_39942108 5月前

    Ready for review & merge

    点赞 评论 复制链接分享

相关推荐