Skip to content

Commit

Permalink
swap() renamed and localized to .cpp file to avoid collisions
Browse files Browse the repository at this point in the history
  • Loading branch information
PaintYourDragon committed Jan 26, 2016
1 parent 5283cb8 commit 485481d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions Adafruit_NeoMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
#endif
#endif

#ifndef _swap_uint16_t
#define _swap_uint16_t(a, b) { uint16_t t = a; a = b; b = t; }
#endif

// Constructor for single matrix:
Adafruit_NeoMatrix::Adafruit_NeoMatrix(int w, int h, uint8_t pin,
uint8_t matrixType, neoPixelType ledType) : Adafruit_GFX(w, h),
Expand Down Expand Up @@ -138,7 +142,7 @@ void Adafruit_NeoMatrix::drawPixel(int16_t x, int16_t y, uint16_t color) {
if((type & NEO_TILE_AXIS) == NEO_TILE_ROWS) {
majorScale = tilesX;
} else {
swap(major, minor);
_swap_uint16_t(major, minor);
majorScale = tilesY;
}

Expand Down Expand Up @@ -175,7 +179,7 @@ void Adafruit_NeoMatrix::drawPixel(int16_t x, int16_t y, uint16_t color) {
if((type & NEO_MATRIX_AXIS) == NEO_MATRIX_ROWS) {
majorScale = matrixWidth;
} else {
swap(major, minor);
_swap_uint16_t(major, minor);
majorScale = matrixHeight;
}

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 NeoMatrix
version=1.1.1
version=1.1.2
author=Adafruit
maintainer=Adafruit <[email protected]>
sentence=Adafruit_GFX-compatible library for NeoPixel grids
Expand Down

0 comments on commit 485481d

Please sign in to comment.