Skip to content

Change swap def to swapOLED, to avoid problems with some platforms #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/SFE_MicroOLED.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,13 +492,13 @@ Draw line using color and mode from x0,y0 to x1,y1 of the screen buffer.
void MicroOLED::line(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t color, uint8_t mode) {
uint8_t steep = abs(y1 - y0) > abs(x1 - x0);
if (steep) {
swap(x0, y0);
swap(x1, y1);
swapOLED(x0, y0);
swapOLED(x1, y1);
}

if (x0 > x1) {
swap(x0, x1);
swap(y0, y1);
swapOLED(x0, x1);
swapOLED(y0, y1);
}

uint8_t dx, dy;
Expand Down
2 changes: 1 addition & 1 deletion src/SFE_MicroOLED.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <pgmspace.h>
#endif

#define swap(a, b) { uint8_t t = a; a = b; b = t; }
#define swapOLED(a, b) { uint8_t t = a; a = b; b = t; }

#define I2C_ADDRESS_SA0_0 0b0111100
#define I2C_ADDRESS_SA0_1 0b0111101
Expand Down