Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cpu/atmega_common: Fix pm_reboot with LTO
The reboot process for ATmegas is to enable the watchdog timer and loop until the wdt reboots this MCU. However, this reboot will keep the wdt configuration, so that the wdt needs to be disabled during boot. This is done in get_mcusr, but without the attribute "used" it will be optimized out in LTO builds. This commits adds the attribute "used" to get_mcusr. Also simplified the backward compatibility with older ATmegas (currently not supported by RIOT) on outdated versions of avrlibc.
- Loading branch information