Skip to content

Commit

Permalink
Update hwCPUVoltage to support ATmega1284P (#1494)
Browse files Browse the repository at this point in the history
Thanks for this contribution @j54n1n 

That microcontroller gets used for example on the MoteinoMEGA board
from LowPowerLab.

Resolves: #1442
See also: https://lowpowerlab.com/guide/moteino/
  • Loading branch information
j54n1n authored Jul 27, 2021
1 parent 7a5a98f commit aa76d26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hal/architecture/AVR/MyHwAVR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ bool hwUniqueID(unique_id_t *uniqueID)
uint16_t hwCPUVoltage(void)
{
// Measure Vcc against 1.1V Vref
#if defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
#if defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1284P__)
ADMUX = (_BV(REFS0) | _BV(MUX4) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1));
#elif defined (__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)
ADMUX = (_BV(MUX5) | _BV(MUX0));
Expand Down

0 comments on commit aa76d26

Please sign in to comment.