Skip to content
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
25 changes: 25 additions & 0 deletions src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,26 @@ void CConfig::Load (void)
m_bEncoderEnabled = m_Properties.GetNumber ("EncoderEnabled", 0) != 0;
m_nEncoderPinClock = m_Properties.GetNumber ("EncoderPinClock", 10);
m_nEncoderPinData = m_Properties.GetNumber ("EncoderPinData", 9);

// Parse encoder resolution
std::string EncoderResolution = m_Properties.GetString ("EncoderResolution", "full");
if (EncoderResolution == "full")
{
m_nEncoderDetents = 4;
}
else if (EncoderResolution == "half")
{
m_nEncoderDetents = 2;
}
else if (EncoderResolution == "quarter")
{
m_nEncoderDetents = 1;
}
else
{
// Invalid value, use default
m_nEncoderDetents = 4;
}

m_bMIDIDumpEnabled = m_Properties.GetNumber ("MIDIDumpEnabled", 0) != 0;
m_bProfileEnabled = m_Properties.GetNumber ("ProfileEnabled", 0) != 0;
Expand Down Expand Up @@ -763,6 +783,11 @@ unsigned CConfig::GetEncoderPinData (void) const
return m_nEncoderPinData;
}

unsigned CConfig::GetEncoderDetents (void) const
{
return m_nEncoderDetents;
}

bool CConfig::GetMIDIDumpEnabled (void) const
{
return m_bMIDIDumpEnabled;
Expand Down
2 changes: 2 additions & 0 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ class CConfig // Configuration for MiniDexed
bool GetEncoderEnabled (void) const;
unsigned GetEncoderPinClock (void) const;
unsigned GetEncoderPinData (void) const;
unsigned GetEncoderDetents (void) const;

// Debug
bool GetMIDIDumpEnabled (void) const;
Expand Down Expand Up @@ -374,6 +375,7 @@ class CConfig // Configuration for MiniDexed
bool m_bEncoderEnabled;
unsigned m_nEncoderPinClock;
unsigned m_nEncoderPinData;
unsigned m_nEncoderDetents;

bool m_bMIDIDumpEnabled;
bool m_bProfileEnabled;
Expand Down
2 changes: 2 additions & 0 deletions src/minidexed.ini
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ MIDIButtonTGDown=56
EncoderEnabled=1
EncoderPinClock=10
EncoderPinData=9
# Encoder resolution: full, half, or quarter (default: full)
EncoderResolution=full

# Debug
MIDIDumpEnabled=0
Expand Down
3 changes: 2 additions & 1 deletion src/userinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ bool CUserInterface::Initialize (void)
m_pRotaryEncoder = new CKY040 (m_pConfig->GetEncoderPinClock (),
m_pConfig->GetEncoderPinData (),
m_pConfig->GetButtonPinShortcut (),
m_pGPIOManager);
m_pGPIOManager,
m_pConfig->GetEncoderDetents ());
assert (m_pRotaryEncoder);

if (!m_pRotaryEncoder->Initialize ())
Expand Down
4 changes: 2 additions & 2 deletions submod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ git submodule update --init --recursive -f

# Use fixed master branch of circle-stdlib then re-update
cd circle-stdlib/
git checkout -f --recurse-submodules 1111eee # Matches Circle Step49
git checkout -f --recurse-submodules v17.2
cd -

# Optional update submodules explicitly
cd circle-stdlib/libs/circle
git checkout -f --recurse-submodules f18c60fa38042ea7132533e658abfafd5bd63435
git checkout -f --recurse-submodules b42d060
cd -
#cd circle-stdlib/libs/circle-newlib
#git checkout develop
Expand Down
Loading