Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clearDisplay() and display() as stubs #411

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
14 changes: 14 additions & 0 deletions Adafruit_GFX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,20 @@ void Adafruit_GFX::writeLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1,
}
}

/**************************************************************************/
/*!
@brief Clear the display, overwrite in subclasses.
*/
/**************************************************************************/
void Adafruit_GFX::clearDisplay() {}

/**************************************************************************/
/*!
@brief Update the display, overwrite in subclasses.
*/
/**************************************************************************/
void Adafruit_GFX::display() {}

/**************************************************************************/
/*!
@brief Start a display-writing routine, overwrite in subclasses.
Expand Down
4 changes: 4 additions & 0 deletions Adafruit_GFX.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
#include "gfxfont.h"

#include <Adafruit_I2CDevice.h>
#ifndef SKIP_SPI
#include <Adafruit_SPIDevice.h>
#endif

/// A generic graphics superclass that can handle all sorts of drawing. At a
/// minimum you can subclass and provide drawPixel(). At a maximum you can do a
Expand Down Expand Up @@ -43,6 +45,8 @@ class Adafruit_GFX : public Print {
virtual void writeLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1,
uint16_t color);
virtual void endWrite(void);
virtual void clearDisplay(void);
virtual void display(void);

// CONTROL API
// These MAY be overridden by the subclass to provide device-specific
Expand Down