@@ -541,11 +541,17 @@ bool Adafruit_SSD1306::begin(uint8_t vcs, uint8_t addr, bool reset,
541541 ssd1306_command1 (HEIGHT - 1 );
542542
543543 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
547545 ssd1306_commandList (init2, sizeof (init2));
548546
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+
549555 ssd1306_command1 ((vccstate == SSD1306_EXTERNALVCC) ? 0x10 : 0x14 );
550556
551557 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,
566572 } else if ((WIDTH == 96 ) && (HEIGHT == 16 )) {
567573 comPins = 0x2 ; // ada x12
568574 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 );
576578 } else {
577579 // Other screen varieties -- TBD
578580 }
0 commit comments