Skip to content

Commit

Permalink
leds: set default type to midi in / note / multi value
Browse files Browse the repository at this point in the history
  • Loading branch information
paradajz committed Mar 10, 2021
1 parent 50f6bd7 commit d291937
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/application/database/CustomInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
*/

#include "database/Database.h"
#include "io/leds/LEDs.h"

void Database::customInitButtons()
{
Expand All @@ -39,10 +40,15 @@ void Database::customInitAnalog()

void Database::customInitLEDs()
{
//same logic as for the buttons
for (int i = 0; i < MAX_NUMBER_OF_LEDS; i++)
{
update(Database::Section::leds_t::activationID, i, i);
update(Database::Section::leds_t::controlType, i, static_cast<int32_t>(IO::LEDs::controlType_t::midiInNoteMultiVal));
}

for (int i = 0; i < MAX_NUMBER_OF_TOUCHSCREEN_COMPONENTS; i++)
{
update(Database::Section::leds_t::activationID, i + MAX_NUMBER_OF_LEDS, i);
update(Database::Section::leds_t::controlType, i + MAX_NUMBER_OF_LEDS, static_cast<int32_t>(IO::LEDs::controlType_t::midiInNoteMultiVal));
}
}
4 changes: 2 additions & 2 deletions tests/src/database/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ TEST_CASE(ReadInitialValues)
TEST_ASSERT_EQUAL_UINT32(0, database.read(Database::Section::leds_t::rgbEnable, i));

//control type section
//all values should be set to 0
//all values should be set to midiInNoteMultiVal
for (int i = 0; i < MAX_NUMBER_OF_LEDS + MAX_NUMBER_OF_TOUCHSCREEN_COMPONENTS; i++)
TEST_ASSERT_EQUAL_UINT32(0, database.read(Database::Section::leds_t::controlType, i));
TEST_ASSERT_EQUAL_UINT32(static_cast<uint32_t>(IO::LEDs::controlType_t::midiInNoteMultiVal), database.read(Database::Section::leds_t::controlType, i));

//activation value section
//all values should be set to 127
Expand Down

0 comments on commit d291937

Please sign in to comment.