Skip to content

Commit 8830fe2

Browse files
authored
Merge pull request #449 from nocnokneo/fix-uint8-pin-overflow
Fix broken reset logic if reset pin exceeds 127 due to int8 overflow
2 parents d472098 + ec6df32 commit 8830fe2

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

Adafruit_GrayOLED.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
allocation is performed there!
6363
*/
6464
Adafruit_GrayOLED::Adafruit_GrayOLED(uint8_t bpp, uint16_t w, uint16_t h,
65-
TwoWire *twi, int8_t rst_pin,
65+
TwoWire *twi, int16_t rst_pin,
6666
uint32_t clkDuring, uint32_t clkAfter)
6767
: Adafruit_GFX(w, h), i2c_preclk(clkDuring), i2c_postclk(clkAfter),
6868
buffer(NULL), dcPin(-1), csPin(-1), rstPin(rst_pin), _bpp(bpp) {
@@ -98,9 +98,9 @@ Adafruit_GrayOLED::Adafruit_GrayOLED(uint8_t bpp, uint16_t w, uint16_t h,
9898
allocation is performed there!
9999
*/
100100
Adafruit_GrayOLED::Adafruit_GrayOLED(uint8_t bpp, uint16_t w, uint16_t h,
101-
int8_t mosi_pin, int8_t sclk_pin,
102-
int8_t dc_pin, int8_t rst_pin,
103-
int8_t cs_pin)
101+
int16_t mosi_pin, int16_t sclk_pin,
102+
int16_t dc_pin, int16_t rst_pin,
103+
int16_t cs_pin)
104104
: Adafruit_GFX(w, h), dcPin(dc_pin), csPin(cs_pin), rstPin(rst_pin),
105105
_bpp(bpp) {
106106

@@ -134,8 +134,8 @@ Adafruit_GrayOLED::Adafruit_GrayOLED(uint8_t bpp, uint16_t w, uint16_t h,
134134
allocation is performed there!
135135
*/
136136
Adafruit_GrayOLED::Adafruit_GrayOLED(uint8_t bpp, uint16_t w, uint16_t h,
137-
SPIClass *spi, int8_t dc_pin,
138-
int8_t rst_pin, int8_t cs_pin,
137+
SPIClass *spi, int16_t dc_pin,
138+
int16_t rst_pin, int16_t cs_pin,
139139
uint32_t bitrate)
140140
: Adafruit_GFX(w, h), dcPin(dc_pin), csPin(cs_pin), rstPin(rst_pin),
141141
_bpp(bpp) {

Adafruit_GrayOLED.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@
4848
class Adafruit_GrayOLED : public Adafruit_GFX {
4949
public:
5050
Adafruit_GrayOLED(uint8_t bpp, uint16_t w, uint16_t h, TwoWire *twi = &Wire,
51-
int8_t rst_pin = -1, uint32_t preclk = 400000,
51+
int16_t rst_pin = -1, uint32_t preclk = 400000,
5252
uint32_t postclk = 100000);
53-
Adafruit_GrayOLED(uint8_t bpp, uint16_t w, uint16_t h, int8_t mosi_pin,
54-
int8_t sclk_pin, int8_t dc_pin, int8_t rst_pin,
55-
int8_t cs_pin);
53+
Adafruit_GrayOLED(uint8_t bpp, uint16_t w, uint16_t h, int16_t mosi_pin,
54+
int16_t sclk_pin, int16_t dc_pin, int16_t rst_pin,
55+
int16_t cs_pin);
5656
Adafruit_GrayOLED(uint8_t bpp, uint16_t w, uint16_t h, SPIClass *spi,
57-
int8_t dc_pin, int8_t rst_pin, int8_t cs_pin,
57+
int16_t dc_pin, int16_t rst_pin, int16_t cs_pin,
5858
uint32_t bitrate = 8000000UL);
5959

6060
~Adafruit_GrayOLED(void);

0 commit comments

Comments
 (0)