Skip to content

Commit ae96f6e

Browse files
committed
private data to protected
1 parent 0de2f56 commit ae96f6e

File tree

2 files changed

+0
-71
lines changed

2 files changed

+0
-71
lines changed

Adafruit_SSD1306.cpp

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@
5656

5757
// SOME DEFINES AND STATIC VARIABLES USED INTERNALLY -----------------------
5858

59-
typedef void (* dfunc_t)(void);//void function pointer
60-
6159
#if defined(I2C_BUFFER_LENGTH)
6260
#define WIRE_MAX min(256, I2C_BUFFER_LENGTH) ///< Particle or similar Wire lib
6361
#elif defined(BUFFER_LENGTH)
@@ -115,7 +113,6 @@ typedef void (* dfunc_t)(void);//void function pointer
115113
// so other I2C device types still work). All of these are encapsulated
116114
// in the TRANSACTION_* macros.
117115

118-
119116
// Check first if Wire, then hardware SPI, then soft SPI:
120117
#define TRANSACTION_START \
121118
if (wire) { \
@@ -973,71 +970,6 @@ void Adafruit_SSD1306::display(void) {
973970
#endif
974971
}
975972

976-
/*!
977-
@brief display with added call to user function pointer
978-
@param dfunc pointer to users display function
979-
980-
@return None (void).
981-
*/
982-
void Adafruit_SSD1306::display_d(dfunc_t dfunc){
983-
TRANSACTION_START
984-
static const uint8_t PROGMEM dlist1[] = {
985-
SSD1306_PAGEADDR,
986-
0, // Page start address
987-
0xFF, // Page end (not really, but works here)
988-
SSD1306_COLUMNADDR, 0}; // Column start address
989-
ssd1306_commandList(dlist1, sizeof(dlist1));
990-
ssd1306_command1(WIDTH - 1); // Column end address
991-
992-
#if defined(ESP8266)
993-
// ESP8266 needs a periodic yield() call to avoid watchdog reset.
994-
// With the limited size of SSD1306 displays, and the fast bitrate
995-
// being used (1 MHz or more), I think one yield() immediately before
996-
// a screen write and one immediately after should cover it. But if
997-
// not, if this becomes a problem, yields() might be added in the
998-
// 32-byte transfer condition below.
999-
yield();
1000-
#endif
1001-
uint16_t count = WIDTH * ((HEIGHT + 7) / 8);
1002-
uint8_t *ptr = buffer;
1003-
if (wire) { // I2C
1004-
wire->beginTransmission(i2caddr);
1005-
WIRE_WRITE((uint8_t)0x40);
1006-
uint16_t bytesOut = 1;
1007-
while (count--) {
1008-
if (bytesOut >= WIRE_MAX) {
1009-
wire->endTransmission();
1010-
wire->beginTransmission(i2caddr);
1011-
WIRE_WRITE((uint8_t)0x40);
1012-
bytesOut = 1;
1013-
}
1014-
WIRE_WRITE(*ptr++);
1015-
bytesOut++;
1016-
//every line give the dfunc a chance to run
1017-
if(dfunc !=NULL){
1018-
if(!(count % WIDTH)){
1019-
wire->endTransmission();
1020-
TRANSACTION_END
1021-
dfunc();
1022-
TRANSACTION_START
1023-
wire->beginTransmission(i2caddr);
1024-
WIRE_WRITE((uint8_t)0x40);
1025-
bytesOut = 1;
1026-
}
1027-
}
1028-
}
1029-
wire->endTransmission();
1030-
} else { // SPI
1031-
SSD1306_MODE_DATA
1032-
while (count--)
1033-
SPIwrite(*ptr++);
1034-
}
1035-
TRANSACTION_END
1036-
#if defined(ESP8266)
1037-
yield();
1038-
#endif
1039-
}
1040-
1041973
// SCROLLING FUNCTIONS -----------------------------------------------------
1042974

1043975
/*!

Adafruit_SSD1306.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ typedef class HardwareSPI SPIClass;
4040
#include <SPI.h>
4141
#include <Wire.h>
4242

43-
typedef void (* dfunc_t)(void);
44-
4543
#if defined(__AVR__)
4644
typedef volatile uint8_t PortReg;
4745
typedef uint8_t PortMask;
@@ -147,7 +145,6 @@ class Adafruit_SSD1306 : public Adafruit_GFX {
147145
bool begin(uint8_t switchvcc = SSD1306_SWITCHCAPVCC, uint8_t i2caddr = 0,
148146
bool reset = true, bool periphBegin = true);
149147
void display(void);
150-
void display_d(dfunc_t dfunc);
151148
void clearDisplay(void);
152149
void invertDisplay(bool i);
153150
void dim(bool dim);

0 commit comments

Comments
 (0)