Closed chaveiro closed 4 years ago
If selectring ATmega328PB board the follow code fails :
#include <avr/power.h> void setup() { power_twi0_disable(); power_spi0_disable(); } void loop() { }
Error:
In function 'void setup()': sketch_may03a:4: error: 'power_twi_disable' was not declared in this scope power_twi0_disable(); ^ exit status 1 'power_twi0_disable' was not declared in this scope
In function 'void setup()':
sketch_may03a:4: error: 'power_twi_disable' was not declared in this scope
power_twi0_disable();
^
exit status 1 'power_twi0_disable' was not declared in this scope
File hardware\tools\avr\avr\include\avr\power.h should have this entry:
#if defined(__AVR_HAVE_PRR0_PRTWI0) #define power_twi0_enable() (PRR0 &= (uint8_t)~(1 << PRTWI0)) #define power_twi0_disable() (PRR0 |= (uint8_t)(1 << PRTWI0)) #endif #if defined(__AVR_HAVE_PRR0_PRSPI0) #define power_spi0_enable() (PRR0 &= (uint8_t)~(1 << PRSPI0)) #define power_spi0_disable() (PRR0 |= (uint8_t)(1 << PRSPI0)) #endif #if defined(__AVR_HAVE_PRR1_PRSPI1) #define power_spi1_enable() (PRR1 &= (uint8_t)~(1 << PRSPI1)) #define power_spi1_disable() (PRR1 |= (uint8_t)(1 << PRSPI1)) #endif
It is an issue from the toolchain: https://github.com/arduino/toolchain-avr/issues/66
If selectring ATmega328PB board the follow code fails :
Error:
File hardware\tools\avr\avr\include\avr\power.h should have this entry: