Skip to content

Commit 4c4b7f0

Browse files
authored
Merge pull request #15 from bryanmtdt/master
Change swap def to swapOLED, to avoid problems with some platforms
2 parents 211fc95 + 855c5f7 commit 4c4b7f0

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
@@ -491,13 +491,13 @@ Draw line using color and mode from x0,y0 to x1,y1 of the screen buffer.
491491
void MicroOLED::line(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t color, uint8_t mode) {
492492
uint8_t steep = abs(y1 - y0) > abs(x1 - x0);
493493
if (steep) {
494-
swap(x0, y0);
495-
swap(x1, y1);
494+
swapOLED(x0, y0);
495+
swapOLED(x1, y1);
496496
}
497497

498498
if (x0 > x1) {
499-
swap(x0, x1);
500-
swap(y0, y1);
499+
swapOLED(x0, x1);
500+
swapOLED(y0, y1);
501501
}
502502

503503
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)