Skip to content

Commit

Permalink
Minor updates for the Chromadeck config
Browse files Browse the repository at this point in the history
  • Loading branch information
Unreal-Dan committed Nov 3, 2023
1 parent 3748784 commit 3a06828
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 5 deletions.
18 changes: 15 additions & 3 deletions VortexEngine/src/Buttons/Buttons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,30 @@
// 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];

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;
}

Expand Down
2 changes: 1 addition & 1 deletion VortexEngine/src/Buttons/Buttons.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
12 changes: 12 additions & 0 deletions VortexEngine/src/Leds/LedTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down
2 changes: 1 addition & 1 deletion VortexEngine/src/VortexConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3a06828

Please sign in to comment.