Skip to content

Commit

Permalink
Back off on the PROGMEM declarations; const is sufficient.
Browse files Browse the repository at this point in the history
  • Loading branch information
PaintYourDragon committed May 9, 2017
1 parent 7589eca commit 07f8f65
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
14 changes: 7 additions & 7 deletions Adafruit_GFX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ void Adafruit_GFX::fillTriangle(int16_t x0, int16_t y0,
// Draw a PROGMEM-resident 1-bit image at the specified (x,y) position,
// using the specified foreground color (unset bits are transparent).
void Adafruit_GFX::drawBitmap(int16_t x, int16_t y,
PROGMEM const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color) {
const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color) {

int16_t byteWidth = (w + 7) / 8; // Bitmap scanline pad = whole byte
uint8_t byte = 0;
Expand All @@ -482,7 +482,7 @@ void Adafruit_GFX::drawBitmap(int16_t x, int16_t y,
// using the specified foreground (for set bits) and background (unset
// bits) colors.
void Adafruit_GFX::drawBitmap(int16_t x, int16_t y,
PROGMEM const uint8_t bitmap[], int16_t w, int16_t h,
const uint8_t bitmap[], int16_t w, int16_t h,
uint16_t color, uint16_t bg) {

int16_t byteWidth = (w + 7) / 8; // Bitmap scanline pad = whole byte
Expand Down Expand Up @@ -544,7 +544,7 @@ void Adafruit_GFX::drawBitmap(int16_t x, int16_t y,
// There is no RAM-resident version of this function; if generating bitmaps
// in RAM, use the format defined by drawBitmap() and call that instead.
void Adafruit_GFX::drawXBitmap(int16_t x, int16_t y,
PROGMEM const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color) {
const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color) {

int16_t byteWidth = (w + 7) / 8; // Bitmap scanline pad = whole byte
uint8_t byte = 0;
Expand All @@ -566,7 +566,7 @@ void Adafruit_GFX::drawXBitmap(int16_t x, int16_t y,
// pos. Specifically for 8-bit display devices such as IS31FL3731;
// no color reduction/expansion is performed.
void Adafruit_GFX::drawGrayscaleBitmap(int16_t x, int16_t y,
PROGMEM const uint8_t bitmap[], int16_t w, int16_t h) {
const uint8_t bitmap[], int16_t w, int16_t h) {
startWrite();
for(int16_t j=0; j<h; j++, y++) {
for(int16_t i=0; i<w; i++ ) {
Expand Down Expand Up @@ -596,7 +596,7 @@ void Adafruit_GFX::drawGrayscaleBitmap(int16_t x, int16_t y,
// Specifically for 8-bit display devices such as IS31FL3731;
// no color reduction/expansion is performed.
void Adafruit_GFX::drawGrayscaleBitmap(int16_t x, int16_t y,
PROGMEM const uint8_t bitmap[], PROGMEM const uint8_t mask[],
const uint8_t bitmap[], const uint8_t mask[],
int16_t w, int16_t h) {
int16_t bw = (w + 7) / 8; // Bitmask scanline pad = whole byte
uint8_t byte = 0;
Expand Down Expand Up @@ -638,7 +638,7 @@ void Adafruit_GFX::drawGrayscaleBitmap(int16_t x, int16_t y,
// Draw a PROGMEM-resident 16-bit image (RGB 5/6/5) at the specified (x,y)
// position. For 16-bit display devices; no color reduction performed.
void Adafruit_GFX::drawRGBBitmap(int16_t x, int16_t y,
PROGMEM const uint16_t bitmap[], int16_t w, int16_t h) {
const uint16_t bitmap[], int16_t w, int16_t h) {
startWrite();
for(int16_t j=0; j<h; j++, y++) {
for(int16_t i=0; i<w; i++ ) {
Expand Down Expand Up @@ -666,7 +666,7 @@ void Adafruit_GFX::drawRGBBitmap(int16_t x, int16_t y,
// BOTH buffers (color and mask) must be PROGMEM-resident.
// For 16-bit display devices; no color reduction performed.
void Adafruit_GFX::drawRGBBitmap(int16_t x, int16_t y,
PROGMEM const uint16_t bitmap[], PROGMEM const uint8_t mask[],
const uint16_t bitmap[], const uint8_t mask[],
int16_t w, int16_t h) {
int16_t bw = (w + 7) / 8; // Bitmask scanline pad = whole byte
uint8_t byte = 0;
Expand Down
14 changes: 7 additions & 7 deletions Adafruit_GFX.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,31 +64,31 @@ class Adafruit_GFX : public Print {
int16_t radius, uint16_t color),
fillRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h,
int16_t radius, uint16_t color),
drawBitmap(int16_t x, int16_t y, PROGMEM const uint8_t bitmap[],
drawBitmap(int16_t x, int16_t y, const uint8_t bitmap[],
int16_t w, int16_t h, uint16_t color),
drawBitmap(int16_t x, int16_t y, PROGMEM const uint8_t bitmap[],
drawBitmap(int16_t x, int16_t y, const uint8_t bitmap[],
int16_t w, int16_t h, uint16_t color, uint16_t bg),
drawBitmap(int16_t x, int16_t y, uint8_t *bitmap,
int16_t w, int16_t h, uint16_t color),
drawBitmap(int16_t x, int16_t y, uint8_t *bitmap,
int16_t w, int16_t h, uint16_t color, uint16_t bg),
drawXBitmap(int16_t x, int16_t y, PROGMEM const uint8_t bitmap[],
drawXBitmap(int16_t x, int16_t y, const uint8_t bitmap[],
int16_t w, int16_t h, uint16_t color),
drawGrayscaleBitmap(int16_t x, int16_t y, PROGMEM const uint8_t bitmap[],
drawGrayscaleBitmap(int16_t x, int16_t y, const uint8_t bitmap[],
int16_t w, int16_t h),
drawGrayscaleBitmap(int16_t x, int16_t y, uint8_t *bitmap,
int16_t w, int16_t h),
drawGrayscaleBitmap(int16_t x, int16_t y,
PROGMEM const uint8_t bitmap[], PROGMEM const uint8_t mask[],
const uint8_t bitmap[], const uint8_t mask[],
int16_t w, int16_t h),
drawGrayscaleBitmap(int16_t x, int16_t y,
uint8_t *bitmap, uint8_t *mask, int16_t w, int16_t h),
drawRGBBitmap(int16_t x, int16_t y, PROGMEM const uint16_t bitmap[],
drawRGBBitmap(int16_t x, int16_t y, const uint16_t bitmap[],
int16_t w, int16_t h),
drawRGBBitmap(int16_t x, int16_t y, uint16_t *bitmap,
int16_t w, int16_t h),
drawRGBBitmap(int16_t x, int16_t y,
PROGMEM const uint16_t bitmap[], PROGMEM const uint8_t mask[],
const uint16_t bitmap[], const uint8_t mask[],
int16_t w, int16_t h),
drawRGBBitmap(int16_t x, int16_t y,
uint16_t *bitmap, uint8_t *mask, int16_t w, int16_t h),
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Adafruit GFX Library
version=1.2.1
version=1.2.2
author=Adafruit
maintainer=Adafruit <[email protected]>
sentence=Adafruit GFX graphics core library, this is the 'core' class that all our other graphics libraries derive from.
Expand Down

0 comments on commit 07f8f65

Please sign in to comment.