File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 3434#include " OLEDDisplay.h"
3535#include < Wire.h>
3636
37+ #ifdef ARDUINO_ARCH_AVR
38+ #define _min min
39+ #define _max max
40+ #endif
41+
3742class SSD1306Wire : public OLEDDisplay {
3843 private:
3944 uint8_t _address;
@@ -51,7 +56,11 @@ class SSD1306Wire : public OLEDDisplay {
5156 }
5257
5358 bool connect () {
59+ #ifdef ARDUINO_ARCH_AVR
60+ Wire.begin ();
61+ #else
5462 Wire.begin (this ->_sda , this ->_scl );
63+ #endif
5564 // Let's use ~700khz if ESP8266 is in 160Mhz mode
5665 // this will be limited to ~400khz if the ESP8266 in 80Mhz mode.
5766 Wire.setClock (700000 );
@@ -166,7 +175,11 @@ class SSD1306Wire : public OLEDDisplay {
166175
167176 void initI2cIfNeccesary () {
168177 if (_doI2cAutoInit) {
169- Wire.begin (this ->_sda , this ->_scl );
178+ #ifdef ARDUINO_ARCH_AVR
179+ Wire.begin ();
180+ #else
181+ Wire.begin (this ->_sda , this ->_scl );
182+ #endif
170183 }
171184 }
172185
You can’t perform that action at this time.
0 commit comments