You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to use sleepMode() with an ATmega328P I found that the SLEEP_... macros are defined with incorrect values in the arduino.h file. The values defined range from 0 through 5, but they should be double what they are, due to a missing left bitshift that is required to align their bits with the SM[2:0] bits in the SMCR register. For example, sleepMode(SLEEP_POWER_DOWN) should pass a binary value of 0100 to SMCR, setting the sleep mode to "Power-down", but it passes 0010, which sets the sleep mode to "ADC Noise Reduction".
The text was updated successfully, but these errors were encountered:
When attempting to use sleepMode() with an ATmega328P I found that the SLEEP_... macros are defined with incorrect values in the arduino.h file. The values defined range from 0 through 5, but they should be double what they are, due to a missing left bitshift that is required to align their bits with the SM[2:0] bits in the SMCR register. For example, sleepMode(SLEEP_POWER_DOWN) should pass a binary value of 0100 to SMCR, setting the sleep mode to "Power-down", but it passes 0010, which sets the sleep mode to "ADC Noise Reduction".
The text was updated successfully, but these errors were encountered: