arduino-libraries / ArduinoLowPower

Powersave features for SAMD boards
GNU Lesser General Public License v2.1
80 stars 57 forks source link

Reduce power consumption during sleep #20

Closed sslupsky closed 3 years ago

sslupsky commented 4 years ago

This PR adds three functions to allow for wake up sources during sleep for Wire, SPI and UART.

It is necessary to make the ArduinoLowPowerClass a friend of TwoWire, SERCOM and Uart and SPIClass classes in the ArduinoCore-samd. I will submit a separate PR for this.

The USB standby/restore that is part of the sleep() function has been removed because it causes significant power consumption during sleep and a 10ms additional delay going to sleep.

sslupsky commented 4 years ago

I previously submitted PR https://github.com/arduino/ArduinoCore-samd/pull/427 to ArduinoCore-samd to address this wake from sleep sources issue. This solution avoids making platform dependent changes to Wire, SPI, Uart and SERCOM as suggested by @sandeepmistry . The previous PR has been closed.

thekunalsaini commented 4 years ago

@sslupsky very less power consumption is saved

thekunalsaini commented 4 years ago

:)