rocketscream / Low-Power

Low Power Library for Arduino
www.rocketscream.com
1.26k stars 345 forks source link

Several unused variables and parameters on ATMega32U4 based boards (Leonardo, Yun) #115

Open eddyp opened 3 years ago

eddyp commented 3 years ago

When compiling for Leonardo I get these warnings:

/home/eddy/opt/arduino-1.8.13/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -Wextra -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8036 "-DUSB_MANUFACTURER=\"Unknown\"" "-DUSB_PRODUCT=\"Arduino Leonardo\"" -I/home/eddy/opt/arduino-1.8.13/hardware/arduino/avr/cores/arduino -I/home/eddy/opt/arduino-1.8.13/hardware/arduino/avr/variants/leonardo -I/home/eddy/Arduino/libraries/Low-Power -I/home/eddy/Arduino/libraries/LiquidCrystal_PCF8574/src -I/home/eddy/opt/arduino-1.8.13/hardware/arduino/avr/libraries/Wire/src -I/home/eddy/Arduino/libraries/EEPROMWearLevel -I/home/eddy/opt/arduino-1.8.13/hardware/arduino/avr/libraries/EEPROM/src /home/eddy/Arduino/libraries/Low-Power/LowPower.cpp -o /tmp/arduino_build_8835/libraries/Low-Power/LowPower.cpp.o /home/eddy/Arduino/libraries/Low-Power/LowPower.cpp: In member function 'void LowPowerClass::adcNoiseReduction(period_t, adc_t, timer2_t)': /home/eddy/Arduino/libraries/Low-Power/LowPower.cpp:664:16: warning: unused variable 'clockSource' [-Wunused-variable] unsigned char clockSource = 0; ^~~ /home/eddy/Arduino/libraries/Low-Power/LowPower.cpp:661:21: warning: unused parameter 'timer2' [-Wunused-parameter] timer2_t timer2) ^~ /home/eddy/Arduino/libraries/Low-Power/LowPower.cpp: In member function 'void LowPowerClass::powerSave(period_t, adc_t, bod_t, timer2_t)': /home/eddy/Arduino/libraries/Low-Power/LowPower.cpp:808:16: warning: unused variable 'clockSource' [-Wunused-variable] unsigned char clockSource = 0; ^~~ /home/eddy/Arduino/libraries/Low-Power/LowPower.cpp:805:22: warning: unused parameter 'timer2' [-Wunused-parameter] timer2_t timer2) ^~ /home/eddy/Arduino/libraries/Low-Power/LowPower.cpp: In member function 'void LowPowerClass::powerExtStandby(period_t, adc_t, bod_t, timer2_t)': /home/eddy/Arduino/libraries/Low-Power/LowPower.cpp:952:16: warning: unused variable 'clockSource' [-Wunused-variable] unsigned char clockSource = 0; ^~~ /home/eddy/Arduino/libraries/Low-Power/LowPower.cpp:949:22: warning: unused parameter 'timer2' [-Wunused-parameter] timer2_t timer2) ^~

As I like to keep 0-warnings projects, these are a problem. Also, if they timer2 parameters are used, are they properly supported?