Description
Describe the bug
On platforms other than ESP32, I get an unused variable warning in the SSD1306Wire
constructor, since only the ARDUINO_ARCH_ESP32
branch references the _i2cBus
parameter.
To Reproduce
Steps to reproduce the behavior:
- Enable warnings in Arduino. V1 instructions: Preferences > Compiler warnings > All.
- Build an ESP8266 (not ESP32) project including SSD1306Wire.h.
Sample code
Provide a MCVE below.
#include "SSD1306Wire.h"
Expected behavior
No compiler warning. Perhaps mark the parameter [[maybe_unused]]
(since C++17), or add a (void)_i2cBus
statement, either in the #if !defined(ARDUINO_ARCH_ESP32)
branch or globally?
Screenshots
If applicable, add screenshots to help explain your problem.
esp8266-oled-ssd1306/src/SSD1306Wire.h
Lines 75 to 85 in f96fd6a
In file included from /home/nyanpasu64/Documents (Shared)/gbs-c/gbs-control/gbs-control.ino:22:
/home/nyanpasu64/Arduino/libraries/esp8266-oled-ssd1306-master/src/SSD1306Wire.h: In constructor 'SSD1306Wire::SSD1306Wire(uint8_t, int, int, OLEDDISPLAY_GEOMETRY, HW_I2C, int)':
/home/nyanpasu64/Arduino/libraries/esp8266-oled-ssd1306-master/src/SSD1306Wire.h:70:114: warning: unused parameter '_i2cBus' [-Wunused-parameter]
70 | SSD1306Wire(uint8_t _address, int _sda = -1, int _scl = -1, OLEDDISPLAY_GEOMETRY g = GEOMETRY_128_64, HW_I2C _i2cBus = I2C_ONE, int _frequency = 700000) {
| ~~~~~~~^~~~~~~~~~~~~~~~~
Versions (please complete the following information):
Additional context
Add any other context about the problem here.