From 815eb23a1e1297468b28fc1739466635c32d08ab Mon Sep 17 00:00:00 2001 From: "Jason A. Cox" Date: Sat, 15 Apr 2023 21:30:50 -0700 Subject: [PATCH] labs(x) macro #32 --- TM1637TinyDisplay.cpp | 1 + TM1637TinyDisplay6.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/TM1637TinyDisplay.cpp b/TM1637TinyDisplay.cpp index eeb2ff1..906b234 100644 --- a/TM1637TinyDisplay.cpp +++ b/TM1637TinyDisplay.cpp @@ -29,6 +29,7 @@ extern "C" { #include #include +#define labs(x) ((x)>0?(x):-(x)) // // A diff --git a/TM1637TinyDisplay6.cpp b/TM1637TinyDisplay6.cpp index 3e0a439..4793f0c 100644 --- a/TM1637TinyDisplay6.cpp +++ b/TM1637TinyDisplay6.cpp @@ -29,6 +29,8 @@ extern "C" { #include #include +#define labs(x) ((x)>0?(x):-(x)) + // Digit sequence map for 6 digit displays const uint8_t digitmap[] = { 2, 1, 0, 5, 4, 3 };