Closed DaveRichmond closed 6 years ago
First of all, thanks for the mod. Im looking at using this for a 64x32 oled.
Secondly, and this is more a general question, but why are we using signed integers? The screens we are talking about all fit in to a uint8_t. You save memory and do not require negative checks if you use uint8_t.
With this pull request, you only consider the default case so (unless im missing something) there is currently no way to propogate a non-default height, width to the child classes like SSD1306 SPI et al who have constructors with pin assignments.
A second thing, the internal use of width() instead of the internal _width parameter adds unnecessary overhead due to the additional function calls.
The use of public width() like this is designed so that external calls dont have direct access to internal variables.
Thank you so much for your contribution and sorry for my late response. Your changes were superseded by other PRs and are now in one or another form part of the code base.
Here's basic support for displays of different sizes. I only have an I2C 64x48 SSD1306 and 128x64 SSD1306 display to test with and have only implemented it for the Wire backend (tried it with brzo but had issues elsewhere with timing).
Hopefully it gives a good starting point if someone has other displays to test with as the display/interface-specific code is fairly minimal.