Skip to content

Commit 6c69ccf

Browse files
author
Greg Smith
committed
Got GP5 p;reset switching and syncing all working
1 parent 510fd56 commit 6c69ccf

File tree

2 files changed

+424
-29
lines changed

2 files changed

+424
-29
lines changed

source/main/control.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,12 @@ static uint8_t process_control_command(tControlMessage* message)
344344
{
345345
ControlData.PresetIndex = message->Value;
346346

347-
memcpy((void*)ControlData.PresetNames[message->Value], (void*)message->Text, MAX_PRESET_NAME_LENGTH);
348-
ControlData.PresetNames[message->Value][MAX_PRESET_NAME_LENGTH - 1] = 0;
347+
if (strlen(message->Text) > 0)
348+
{
349+
// update name text
350+
memcpy((void*)ControlData.PresetNames[message->Value], (void*)message->Text, MAX_PRESET_NAME_LENGTH);
351+
ControlData.PresetNames[message->Value][MAX_PRESET_NAME_LENGTH - 1] = 0;
352+
}
349353

350354
#if CONFIG_TONEX_CONTROLLER_HAS_DISPLAY
351355
// update UI

0 commit comments

Comments
 (0)