Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken reset logic if reset pin exceeds 127 due to int8 overflow #449

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Adafruit_GrayOLED.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
allocation is performed there!
*/
Adafruit_GrayOLED::Adafruit_GrayOLED(uint8_t bpp, uint16_t w, uint16_t h,
TwoWire *twi, int8_t rst_pin,
TwoWire *twi, int16_t rst_pin,
uint32_t clkDuring, uint32_t clkAfter)
: Adafruit_GFX(w, h), i2c_preclk(clkDuring), i2c_postclk(clkAfter),
buffer(NULL), dcPin(-1), csPin(-1), rstPin(rst_pin), _bpp(bpp) {
Expand Down Expand Up @@ -97,9 +97,9 @@ Adafruit_GrayOLED::Adafruit_GrayOLED(uint8_t bpp, uint16_t w, uint16_t h,
allocation is performed there!
*/
Adafruit_GrayOLED::Adafruit_GrayOLED(uint8_t bpp, uint16_t w, uint16_t h,
int8_t mosi_pin, int8_t sclk_pin,
int8_t dc_pin, int8_t rst_pin,
int8_t cs_pin)
int16_t mosi_pin, int16_t sclk_pin,
int16_t dc_pin, int16_t rst_pin,
int16_t cs_pin)
: Adafruit_GFX(w, h), dcPin(dc_pin), csPin(cs_pin), rstPin(rst_pin),
_bpp(bpp) {

Expand Down Expand Up @@ -133,8 +133,8 @@ Adafruit_GrayOLED::Adafruit_GrayOLED(uint8_t bpp, uint16_t w, uint16_t h,
allocation is performed there!
*/
Adafruit_GrayOLED::Adafruit_GrayOLED(uint8_t bpp, uint16_t w, uint16_t h,
SPIClass *spi, int8_t dc_pin,
int8_t rst_pin, int8_t cs_pin,
SPIClass *spi, int16_t dc_pin,
int16_t rst_pin, int16_t cs_pin,
uint32_t bitrate)
: Adafruit_GFX(w, h), dcPin(dc_pin), csPin(cs_pin), rstPin(rst_pin),
_bpp(bpp) {
Expand Down
10 changes: 5 additions & 5 deletions Adafruit_GrayOLED.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@
class Adafruit_GrayOLED : public Adafruit_GFX {
public:
Adafruit_GrayOLED(uint8_t bpp, uint16_t w, uint16_t h, TwoWire *twi = &Wire,
int8_t rst_pin = -1, uint32_t preclk = 400000,
int16_t rst_pin = -1, uint32_t preclk = 400000,
uint32_t postclk = 100000);
Adafruit_GrayOLED(uint8_t bpp, uint16_t w, uint16_t h, int8_t mosi_pin,
int8_t sclk_pin, int8_t dc_pin, int8_t rst_pin,
int8_t cs_pin);
Adafruit_GrayOLED(uint8_t bpp, uint16_t w, uint16_t h, int16_t mosi_pin,
int16_t sclk_pin, int16_t dc_pin, int16_t rst_pin,
int16_t cs_pin);
Adafruit_GrayOLED(uint8_t bpp, uint16_t w, uint16_t h, SPIClass *spi,
int8_t dc_pin, int8_t rst_pin, int8_t cs_pin,
int16_t dc_pin, int16_t rst_pin, int16_t cs_pin,
uint32_t bitrate = 8000000UL);

~Adafruit_GrayOLED(void);
Expand Down
Loading