Skip to content

Commit 855c5f7

Browse files
committed
Change swap def to swapOLED, to avoid problems with some platforms
1 parent 6ccbba3 commit 855c5f7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/SFE_MicroOLED.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -492,13 +492,13 @@ Draw line using color and mode from x0,y0 to x1,y1 of the screen buffer.
492492
void MicroOLED::line(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t color, uint8_t mode) {
493493
uint8_t steep = abs(y1 - y0) > abs(x1 - x0);
494494
if (steep) {
495-
swap(x0, y0);
496-
swap(x1, y1);
495+
swapOLED(x0, y0);
496+
swapOLED(x1, y1);
497497
}
498498

499499
if (x0 > x1) {
500-
swap(x0, x1);
501-
swap(y0, y1);
500+
swapOLED(x0, x1);
501+
swapOLED(y0, y1);
502502
}
503503

504504
uint8_t dx, dy;

src/SFE_MicroOLED.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
4747
#include <pgmspace.h>
4848
#endif
4949

50-
#define swap(a, b) { uint8_t t = a; a = b; b = t; }
50+
#define swapOLED(a, b) { uint8_t t = a; a = b; b = t; }
5151

5252
#define I2C_ADDRESS_SA0_0 0b0111100
5353
#define I2C_ADDRESS_SA0_1 0b0111101

0 commit comments

Comments
 (0)