Compiles against mbed OS 5
Fork of Adafruit_GFX_1351 by
Revision 20:a42316f33f7c, committed 2016-08-25
- Comitter:
- janjongboom
- Date:
- Thu Aug 25 12:31:43 2016 +0000
- Parent:
- 19:ca4a631bfbd8
- Commit message:
- swap -> SWAP because ARMCC doesn't like it
Changed in this revision
diff -r ca4a631bfbd8 -r a42316f33f7c Adafruit_GFX.h --- a/Adafruit_GFX.h Fri Aug 19 02:22:03 2016 +0000 +++ b/Adafruit_GFX.h Thu Aug 25 12:31:43 2016 +0000 @@ -22,7 +22,7 @@ #include "Adafruit_GFX_Config.h" -static inline void swap(int16_t &a, int16_t &b) +static inline void SWAP(int16_t &a, int16_t &b) { int16_t t = a;
diff -r ca4a631bfbd8 -r a42316f33f7c Adafruit_SSD1351.cpp --- a/Adafruit_SSD1351.cpp Fri Aug 19 02:22:03 2016 +0000 +++ b/Adafruit_SSD1351.cpp Thu Aug 25 12:31:43 2016 +0000 @@ -125,7 +125,7 @@ rawFillRect(x, y, w, h, fillcolor); break; case 1: // Rotated 90 degrees clockwise. - swap(x, y); + SWAP(x, y); x = _rawWidth - x - h; rawFillRect(x, y, h, w, fillcolor); break; @@ -135,7 +135,7 @@ rawFillRect(x, y, w, h, fillcolor); break; case 3: // Rotated 270 degrees clockwise. - swap(x, y); + SWAP(x, y); y = _rawHeight - y - w; rawFillRect(x, y, h, w, fillcolor); break; @@ -209,7 +209,7 @@ rawFastVLine(x, y, h, color); break; case 1: // Rotated 90 degrees clockwise. - swap(x, y); + SWAP(x, y); x = _rawWidth - x - h; rawFastHLine(x, y, h, color); break; @@ -219,7 +219,7 @@ rawFastVLine(x, y, h, color); break; case 3: // Rotated 270 degrees clockwise. - swap(x, y); + SWAP(x, y); y = _rawHeight - y - 1; rawFastHLine(x, y, h, color); break; @@ -233,7 +233,7 @@ rawFastHLine(x, y, w, color); break; case 1: // Rotated 90 degrees clockwise. - swap(x, y); + SWAP(x, y); x = _rawWidth - x - 1; rawFastVLine(x, y, w, color); break; @@ -243,7 +243,7 @@ rawFastHLine(x, y, w, color); break; case 3: // Rotated 270 degrees clockwise. - swap(x, y); + SWAP(x, y); y = _rawHeight - y - w; rawFastVLine(x, y, w, color); break; @@ -256,7 +256,7 @@ switch (getRotation()) { // Case 0: No rotation case 1: // Rotated 90 degrees clockwise. - swap(x, y); + SWAP(x, y); x = _rawWidth - x - 1; break; case 2: // Rotated 180 degrees clockwise. @@ -264,7 +264,7 @@ y = _rawHeight - y - 1; break; case 3: // Rotated 270 degrees clockwise. - swap(x, y); + SWAP(x, y); y = _rawHeight - y - 1; break; }
diff -r ca4a631bfbd8 -r a42316f33f7c Adafruit_SSD1351.h --- a/Adafruit_SSD1351.h Fri Aug 19 02:22:03 2016 +0000 +++ b/Adafruit_SSD1351.h Thu Aug 25 12:31:43 2016 +0000 @@ -21,7 +21,7 @@ #include "Adafruit_GFX.h" -#define swap(a, b) { uint16_t t = a; a = b; b = t; } +#define SWAP(a, b) { uint16_t t = a; a = b; b = t; } #define SSD1351WIDTH 128 #define SSD1351HEIGHT 128 // SET THIS TO 96 FOR 1.27"!