power_usart3_endable/-_disable missing ? (Mega2560)

Hi,

(Arduino IDE 1.8.3 / Gentoo-Linux / Arduino Mega2560 )

While compiling the Low-Power Library (see Library Manager) for the Arduino Mega2560 I came accross
a compilation error saying:

Low-Power/LowPower.cpp:440:49: error: 'power_usart3_disable' was not declared in this scope

I grepped through my Arduino-1.8.3 installation and found this:

hardware/tools/avr/avr/include/avr/power.h:    <td>power_usart_enable()</td>
hardware/tools/avr/avr/include/avr/power.h:    <td>power_usart_disable()</td>
hardware/tools/avr/avr/include/avr/power.h:    <td>power_usart0_enable()</td>
hardware/tools/avr/avr/include/avr/power.h:    <td>power_usart0_disable()</td>
hardware/tools/avr/avr/include/avr/power.h:    <td>power_usart1_enable()</td>
hardware/tools/avr/avr/include/avr/power.h:    <td>power_usart1_disable()</td>
hardware/tools/avr/avr/include/avr/power.h:    <td>power_usart2_enable()</td>
hardware/tools/avr/avr/include/avr/power.h:    <td>power_usart2_disable()</td>
hardware/tools/avr/avr/include/avr/power.h:    <td>power_usart3_enable()</td>
hardware/tools/avr/avr/include/avr/power.h:    <td>power_usart3_disable()</td>

and further down:

hardware/tools/avr/avr/include/avr/power.h:#define power_usart_enable()    (PRR &= (uint8_t)~(1 << PRUSART))
hardware/tools/avr/avr/include/avr/power.h:#define power_usart_disable()   (PRR |= (uint8_t)(1 << PRUSART))
hardware/tools/avr/avr/include/avr/power.h:#define power_usart0_enable()   (PRR &= (uint8_t)~(1 << PRUSART0))
hardware/tools/avr/avr/include/avr/power.h:#define power_usart0_disable()  (PRR |= (uint8_t)(1 << PRUSART0))
hardware/tools/avr/avr/include/avr/power.h:#define power_usart1_enable()   (PRR &= (uint8_t)~(1 << PRUSART1))
hardware/tools/avr/avr/include/avr/power.h:#define power_usart1_disable()  (PRR |= (uint8_t)(1 << PRUSART1))
hardware/tools/avr/avr/include/avr/power.h:#define power_usart0_enable()           (PRR0 &= (uint8_t)~(1 << PRUSART0))
hardware/tools/avr/avr/include/avr/power.h:#define power_usart0_disable()          (PRR0 |= (uint8_t)(1 << PRUSART0))
hardware/tools/avr/avr/include/avr/power.h:#define power_usart1_enable()           (PRR0 &= (uint8_t)~(1 << PRUSART1))
hardware/tools/avr/avr/include/avr/power.h:#define power_usart1_disable()          (PRR0 |= (uint8_t)(1 << PRUSART1))
hardware/tools/avr/avr/include/avr/power.h:#define power_usart1_enable()           (PRR1 &= (uint8_t)~(1 << PRUSART1))
hardware/tools/avr/avr/include/avr/power.h:#define power_usart1_disable()          (PRR1 |= (uint8_t)(1 << PRUSART1))
hardware/tools/avr/avr/include/avr/power.h:#define power_usart2_enable()           (PRR1 &= (uint8_t)~(1 << PRUSART2))
hardware/tools/avr/avr/include/avr/power.h:#define power_usart2_disable()          (PRR1 |= (uint8_t)(1 << PRUSART2))
hardware/tools/avr/avr/include/avr/power.h:#define power_usartc0_enable()  (PR_PRPC &= (uint8_t)~(PR_USART0_bm))
hardware/tools/avr/avr/include/avr/power.h:#define power_usartc0_disable() (PR_PRPC |= (uint8_t)PR_USART0_bm)

Is the definition of power_usart3_enable and power_usart3_disable really missing or what did
I wrong here?

Cheers
mcc

See:

for the explanation of the cause.

Hi,

ok, thanks for the link.

Remains the question: When will it be fixed?

Cheers
mcc

Good news! It looks like a new version of the AVR toolchain was recently released by Atmel which includes the fix for this bug. It is currently in beta testing for inclusion with the Arduino IDE so hopefully it will be included with the next IDE release. If you want to upgrade now you can do so by following these instructions (from Staging AVR toolchain 3.6.0 (with 328pb support files) by facchinm · Pull Request #47 · arduino/toolchain-avr · GitHub):

Be warned that this is still in beta testing but I have been using it for the last two weeks without having any problems.

Hi,

OH YEAH! Never before such a thing was fixed that quickly!
This saves my Nixie clock project to go into an idle loop!
I like those kinds of interrupts!
And I will act opon quickly!
...as usual within interrupt routines...
:wink:

Cheers
mcc

pert:
Good news! It looks like a new version of the AVR toolchain was recently released by Atmel which includes the fix for this bug..

Many thanks for reporting the solution. The issue still remains in current IDE v1.85 :-/ but now I can compile my old project with v1.05, v1.65 and v1.85.