Skip to content

Commit e948411

Browse files
committed
dont use 'swap' - breaks esp8266
1 parent 3a569e7 commit e948411

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

Adafruit_SSD1331.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ void Adafruit_SSD1331::drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1,
191191
// check rotation, move pixel around if necessary
192192
switch (getRotation()) {
193193
case 1:
194-
swap(x0, y0);
195-
swap(x1, y1);
194+
gfx_swap(x0, y0);
195+
gfx_swap(x1, y1);
196196
x0 = WIDTH - x0 - 1;
197197
x1 = WIDTH - x1 - 1;
198198
break;
@@ -203,8 +203,8 @@ void Adafruit_SSD1331::drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1,
203203
y1 = HEIGHT - y1 - 1;
204204
break;
205205
case 3:
206-
swap(x0, y0);
207-
swap(x1, y1);
206+
gfx_swap(x0, y0);
207+
gfx_swap(x1, y1);
208208
y0 = HEIGHT - y0 - 1;
209209
y1 = HEIGHT - y1 - 1;
210210
break;
@@ -243,15 +243,15 @@ void Adafruit_SSD1331::drawPixel(int16_t x, int16_t y, uint16_t color)
243243
// check rotation, move pixel around if necessary
244244
switch (getRotation()) {
245245
case 1:
246-
swap(x, y);
246+
gfx_swap(x, y);
247247
x = WIDTH - x - 1;
248248
break;
249249
case 2:
250250
x = WIDTH - x - 1;
251251
y = HEIGHT - y - 1;
252252
break;
253253
case 3:
254-
swap(x, y);
254+
gfx_swap(x, y);
255255
y = HEIGHT - y - 1;
256256
break;
257257
}

Adafruit_SSD1331.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020
#include "WProgram.h"
2121
#endif
2222

23-
#ifndef swap
24-
#define swap(a, b) { uint16_t t = a; a = b; b = t; }
25-
#endif
23+
#define gfx_swap(a, b) { uint16_t t = a; a = b; b = t; }
2624

2725
#ifdef __SAM3X8E__
2826
typedef volatile RwReg PortReg;

0 commit comments

Comments
 (0)