From 0c1e874d74df3fa3fd0a1b065c5972bc9e5347e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20G=C3=B6rner?= Date: Wed, 10 Oct 2018 00:22:20 +0200 Subject: [PATCH] Replace defines by constexpr variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Several define directives could be replaced by constexpr variable definitions. This adds type safety with no overhead costs. Signed-off-by: Max Görner --- src/Kaleidoscope-Model01-TestMode.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Kaleidoscope-Model01-TestMode.cpp b/src/Kaleidoscope-Model01-TestMode.cpp index b8647ae9..c130c740 100644 --- a/src/Kaleidoscope-Model01-TestMode.cpp +++ b/src/Kaleidoscope-Model01-TestMode.cpp @@ -19,11 +19,11 @@ #include "Kaleidoscope-LEDEffect-Rainbow.h" -#define CHATTER_CYCLE_LIMIT 30 -#define TOGGLED_OFF 2 -#define TOGGLED_ON 1 -#define HELD 3 -#define RELEASED 0 +constexpr uint8_t CHATTER_CYCLE_LIMIT = 30; +constexpr uint8_t TOGGLED_OFF = 2; +constexpr uint8_t TOGGLED_ON = 1; +constexpr uint8_t HELD = 3; +constexpr uint8_t RELEASED = 0; kaleidoscope::EventHandlerResult TestMode_::beforeReportingState() {