Refactor idle() to reduce code size

This commit is contained in:
Scott Allen 2018-01-21 15:25:42 -05:00
parent bd726fc112
commit 6e1c47cbe0
1 changed files with 3 additions and 2 deletions

View File

@ -261,8 +261,9 @@ void Arduboy2Core::safeMode()
void Arduboy2Core::idle() void Arduboy2Core::idle()
{ {
set_sleep_mode(SLEEP_MODE_IDLE); SMCR = _BV(SE); // select idle mode and enable sleeping
sleep_mode(); sleep_cpu();
SMCR = 0; // disable sleeping
} }
void Arduboy2Core::bootPowerSaving() void Arduboy2Core::bootPowerSaving()