Comments (3)
@benoitm974 what is your take on this? I ask for your opinion as you contributed the code in question back then.
from esp8266-oled-ssd1306.
I actually feel the "unused arguments" warning is too noisy and turn it off in my personal projects, but it's difficult to set custom compiler flags on Arduino IDE v1, and reducing the warning level turns off other useful warnings as well. In this case I think (void)_i2cBus
isn't too ugly of a change to make.
In any case, should the _i2cBus argument even exist outside of ESP32? Though removing the argument on some platforms can break code on a platform-dependent basis, which is even worse than leaving it in.
Should the HW_I2C type only define I2C_TWO on ESP32, and otherwise be a one-value enum to prevent users from passing in I2C_TWO on ESP8266 which is silently ignored? Or is it better to leave I2C_TWO in?
from esp8266-oled-ssd1306.
@marcelstoer Thanks for the head up and kind attention on this contribution.
Since this code is executed at init only why don't we secure it by adding a test/assert in case someone is trying to use a second wire on another ESP32 platform with no 2nd Wire?
#if !defined(ARDUINO_ARCH_ESP32) //assert on trying to use a second wire on non-ESP32 platform. assert(_i2cBus!=I2C_ONE) this->_wire = &Wire; #else this->_wire = (_i2cBus==I2C_ONE) ? &Wire : &Wire1; #endif
Benoit
from esp8266-oled-ssd1306.
Related Issues (20)
- Displayed content is shifted after some time HOT 9
- String in negative HOT 2
- I2C_ONE / I2C_TWO are not declared but the HW_I2C enum is?
- display.flipScreenVertically(); does not rotate or flip display
- drawStringMaxWidth doesn't return 0 even though text fits
- How change color text? HOT 1
- The bitmap drawing is not compatible with the img2cpp websites. The data needs to be fliped every 8bits. HOT 5
- display.init() crashes serial on ESP32-C3-01M HOT 1
- SSD1306Wire.h, line 145 causes compilation error 'byte' is ambiguous HOT 1
- rotate 90
- SSD1306TwoScreenDemo ESP32 doesn't work HOT 2
- Reset signal HOT 2
- No way to clear logBuffer HOT 1
- Speed, lots of it!
- Huge font size - possible? HOT 6
- Small tweaks allows running on ATMega2560 HOT 1
- Support for extended ASCII for font 3x5 and font 5x5
- My display has gone blank since upgrading to 4.6.0 HOT 4
- I2C Error with 4.6.0 upgrade HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp8266-oled-ssd1306.