Skip to content
Closed
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
5 changes: 3 additions & 2 deletions OLEDDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ void OLEDDisplay::drawFastImage(int16_t xMove, int16_t yMove, int16_t width, int

void OLEDDisplay::drawXbm(int16_t xMove, int16_t yMove, int16_t width, int16_t height, const char *xbm) {
int16_t widthInXbm = (width + 7) / 8;
uint8_t data;
uint8_t data = 0;

for(int16_t y = 0; y < height; y++) {
for(int16_t x = 0; x < width; x++ ) {
Expand Down Expand Up @@ -388,6 +388,8 @@ void OLEDDisplay::drawStringInternal(int16_t xMove, int16_t yMove, char* text, u
case TEXT_ALIGN_RIGHT:
xMove -= textWidth;
break;
case TEXT_ALIGN_LEFT:
break;
}

// Don't draw anything if it is not on the screen.
Expand Down Expand Up @@ -719,7 +721,6 @@ void inline OLEDDisplay::drawInternal(int16_t xMove, int16_t yMove, int16_t widt
int16_t xPos = xMove + (i / rasterHeight);
int16_t yPos = ((yMove >> 3) + (i % rasterHeight)) * DISPLAY_WIDTH;

int16_t yScreenPos = yMove + yOffset;
int16_t dataPos = xPos + yPos;

if (dataPos >= 0 && dataPos < DISPLAY_BUFFER_SIZE &&
Expand Down
15 changes: 10 additions & 5 deletions OLEDDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,14 @@


// Display settings
#define DISPLAY_WIDTH 128
#define DISPLAY_HEIGHT 64
#define DISPLAY_BUFFER_SIZE 1024

#ifndef DISPLAY_WIDTH
#define DISPLAY_WIDTH 128
#endif
#ifndef DISPLAY_HEIGHT
#define DISPLAY_HEIGHT 64
#endif
#define DISPLAY_BUFFER_SIZE DISPLAY_WIDTH * DISPLAY_HEIGHT / 8

// Header Values
#define JUMPTABLE_BYTES 4
Expand Down Expand Up @@ -247,10 +252,10 @@ class OLEDDisplay : public Print {
char *logBuffer = NULL;

// Send a command to the display (low level function)
virtual void sendCommand(uint8_t com) {};
virtual void sendCommand(uint8_t com) {(void)com;};

// Connect to the display
virtual bool connect() {};
virtual bool connect() {return false;};

// Send all the init commands
void sendInitCommands();
Expand Down
6 changes: 3 additions & 3 deletions OLEDDisplayUi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ void OLEDDisplayUi::drawFrame(){
switch (this->state.frameState){
case IN_TRANSITION: {
float progress = (float) this->state.ticksSinceLastStateSwitch / (float) this->ticksPerTransition;
int16_t x, y, x1, y1;
int16_t x = 0, y = 0, x1 = 0, y1 = 0;
switch(this->frameAnimationDirection){
case SLIDE_LEFT:
x = -128 * progress;
Expand Down Expand Up @@ -331,7 +331,7 @@ void OLEDDisplayUi::drawIndicator() {
return;
}

uint8_t posOfHighlightFrame;
uint8_t posOfHighlightFrame = 0;
float indicatorFadeProgress = 0;

// if the indicator needs to be slided in we want to
Expand Down Expand Up @@ -362,7 +362,7 @@ void OLEDDisplayUi::drawIndicator() {

uint16_t frameStartPos = (12 * frameCount / 2);
const char *image;
uint16_t x,y;
uint16_t x = 0, y = 0;
for (byte i = 0; i < this->frameCount; i++) {

switch (this->indicatorPosition){
Expand Down
2 changes: 1 addition & 1 deletion SSD1306Wire.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class SSD1306Wire : public OLEDDisplay {
// If the minBoundY wasn't updated
// we can savely assume that buffer_back[pos] == buffer[pos]
// holdes true for all values of pos
if (minBoundY == ~0) return;
if (minBoundY == (uint8_t)(~0)) return;

sendCommand(COLUMNADDR);
sendCommand(minBoundX);
Expand Down