ThingPulse / esp8266-oled-ssd1306

Driver for the SSD1306 and SH1106 based 128x64, 128x32, 64x48 pixel OLED display running on ESP8266/ESP32
https://thingpulse.com
Other
1.98k stars 638 forks source link

Small tweaks allows running on ATMega2560 #403

Closed ClutchplateDude closed 1 month ago

ClutchplateDude commented 3 months ago

Describe the bug The library does not compile out of the box for an Arduino ATMega2560 board (or any other 8-bit board)

To Reproduce Steps to reproduce the behavior:

  1. Open Sketch
  2. Set Board to and Arduino Mega2560
  3. Compile
  4. _frequency overflow

Expected behavior Would be great to be able to use this library on a Arduino 8-bit board (almost there)

Versions (please complete the following information):

Additional context If the type of the _frequency variable of the SSD1306Wire class is changed from int to long, it will work. Also, using PlatformIO, I get compiler warnings about ctor parameters shadowing members. If you remove the leading underscores from the ctor parameters, it goes away.

ClutchplateDude commented 3 months ago

I have tested this on our project that can be built for Mega2560 and ESP32 and the library works on both platforms with this tweak. I will open a PR for this shortly.