From 485481da49acb784d1fc8334be30215ac8bcca92 Mon Sep 17 00:00:00 2001 From: Phillip Burgess Date: Tue, 26 Jan 2016 10:37:24 -0800 Subject: [PATCH] swap() renamed and localized to .cpp file to avoid collisions --- Adafruit_NeoMatrix.cpp | 8 ++++++-- library.properties | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Adafruit_NeoMatrix.cpp b/Adafruit_NeoMatrix.cpp index 9b81c3a..82fcd1a 100644 --- a/Adafruit_NeoMatrix.cpp +++ b/Adafruit_NeoMatrix.cpp @@ -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), @@ -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; } @@ -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; } diff --git a/library.properties b/library.properties index 9d38073..8054f96 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Adafruit NeoMatrix -version=1.1.1 +version=1.1.2 author=Adafruit maintainer=Adafruit sentence=Adafruit_GFX-compatible library for NeoPixel grids