@@ -541,11 +541,17 @@ bool Adafruit_SSD1306::begin(uint8_t vcs, uint8_t addr, bool reset,
541
541
ssd1306_command1 (HEIGHT - 1 );
542
542
543
543
static const uint8_t PROGMEM init2[] = {SSD1306_SETDISPLAYOFFSET, // 0xD3
544
- 0x0 , // no offset
545
- SSD1306_SETSTARTLINE | 0x0 , // line #0
546
- SSD1306_CHARGEPUMP}; // 0x8D
544
+ 0x0 ); // no offset
547
545
ssd1306_commandList (init2, sizeof (init2));
548
546
547
+ if ((WIDTH == 64 ) && (HEIGHT == 32 )) {
548
+ ssd1306_command1 (0x00 ); // line #0
549
+ } else {
550
+ ssd1306_command1 (SSD1306_SETSTARTLINE); // 0x40
551
+ }
552
+
553
+ ssd1306_command1 (SSD1306_CHARGEPUMP}; // 0x8D
554
+
549
555
ssd1306_command1 ((vccstate == SSD1306_EXTERNALVCC) ? 0x10 : 0x14 );
550
556
551
557
static const uint8_t PROGMEM init3[] = {SSD1306_MEMORYMODE, // 0x20
@@ -566,13 +572,9 @@ bool Adafruit_SSD1306::begin(uint8_t vcs, uint8_t addr, bool reset,
566
572
} else if ((WIDTH == 96 ) && (HEIGHT == 16 )) {
567
573
comPins = 0x2 ; // ada x12
568
574
contrast = (vccstate == SSD1306_EXTERNALVCC) ? 0x10 : 0xAF ;
569
- } else if ((WIDTH == 64 ) && (HEIGHT == 48 )) {
570
- static const uint8_t PROGMEM init4d[] = {
571
- SSD1306_SETCOMPINS, // 0xDA
572
- 0x12 ,
573
- SSD1306_SETCONTRAST }; // 0x81
574
- ssd1306_commandList (init4d, sizeof (init4d));
575
- ssd1306_command1 ((vccstate == SSD1306_EXTERNALVCC) ? 0x9F : 0xCF );
575
+ } else if ((WIDTH == 64 ) && ((HEIGHT == 48 ) || (HEIGHT == 32 ))) {
576
+ comPins = 0x12 ;
577
+ contrast = (vccstate == SSD1306_EXTERNALVCC) ? 0x9F : 0xCF );
576
578
} else {
577
579
// Other screen varieties -- TBD
578
580
}
0 commit comments