From 3a06828523e4edc5371168d743815f606d47fc2d Mon Sep 17 00:00:00 2001 From: Dan Date: Fri, 3 Nov 2023 03:46:23 -0700 Subject: [PATCH] Minor updates for the Chromadeck config --- VortexEngine/src/Buttons/Buttons.cpp | 18 +++++++++++++++--- VortexEngine/src/Buttons/Buttons.h | 2 +- VortexEngine/src/Leds/LedTypes.h | 12 ++++++++++++ VortexEngine/src/VortexConfig.h | 2 +- 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/VortexEngine/src/Buttons/Buttons.cpp b/VortexEngine/src/Buttons/Buttons.cpp index 466b22920c..b4a38ee326 100644 --- a/VortexEngine/src/Buttons/Buttons.cpp +++ b/VortexEngine/src/Buttons/Buttons.cpp @@ -13,7 +13,15 @@ // still allowing for a second instance to be added. I wish there was a more // elegant way to make the button accessible but not global. // This will simply point at Buttons::m_button. -Button *g_pButton = nullptr; + +// Button Left +Button *g_pButtonL = nullptr; + +// Button Mid +Button *g_pButtonM = nullptr; + +// Button Right +Button *g_pButtonR = nullptr; // static members Button Buttons::m_buttons[NUM_BUTTONS]; @@ -21,10 +29,14 @@ Button Buttons::m_buttons[NUM_BUTTONS]; bool Buttons::init() { // initialize the button on pin 1 - if (!m_buttons[0].init(1)) { + if (!m_buttons[0].init(1) || + !m_buttons[1].init(2) || + !m_buttons[2].init(3)) { return false; } - g_pButton = &m_buttons[0]; + g_pButtonL = &m_buttons[0]; + g_pButtonM = &m_buttons[1]; + g_pButtonR = &m_buttons[2]; return true; } diff --git a/VortexEngine/src/Buttons/Buttons.h b/VortexEngine/src/Buttons/Buttons.h index 71736478d4..8af5e74fb0 100644 --- a/VortexEngine/src/Buttons/Buttons.h +++ b/VortexEngine/src/Buttons/Buttons.h @@ -7,7 +7,7 @@ // changing it won't really work without updating other things // like which pins the buttons are attached to. So this is more // of a hardcoded constant than a configuration setting -#define NUM_BUTTONS 1 +#define NUM_BUTTONS 3 class Buttons { diff --git a/VortexEngine/src/Leds/LedTypes.h b/VortexEngine/src/Leds/LedTypes.h index b5b4e07d22..71eea0909f 100644 --- a/VortexEngine/src/Leds/LedTypes.h +++ b/VortexEngine/src/Leds/LedTypes.h @@ -24,6 +24,18 @@ enum LedPos : uint8_t LED_8, LED_9, + // inner circle of leds + LED_10, + LED_11, + LED_12, + LED_13, + LED_14, + LED_15, + LED_16, + LED_17, + LED_18, + LED_19, + // the number of entries above LED_COUNT, diff --git a/VortexEngine/src/VortexConfig.h b/VortexEngine/src/VortexConfig.h index f031a7ea01..5cc95d1815 100644 --- a/VortexEngine/src/VortexConfig.h +++ b/VortexEngine/src/VortexConfig.h @@ -26,7 +26,7 @@ // the engine flavour, this should change for each device/flavour // of the engine that branches off from the main indefinitely -#define VORTEX_NAME "Core" +#define VORTEX_NAME "Chromadeck" // the full name of this build for ex: // Vortex Engine v1.0 'Igneous' (built Tue Jan 31 19:03:55 2023)