Skip to content

Commit

Permalink
Update GPIO.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
chromoxdor committed Sep 28, 2023
1 parent d125cd3 commit 94e1d91
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/src/Commands/GPIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,15 +388,9 @@ const __FlashStringHelper * Command_GPIO_RTTTL(struct EventStruct *event, const
// First assume 'new' syntax: rtttl,<gpio>,<rtttl string>
// Difference between 'old' and 'new':
// Comma between the GPIO argument and the melody
String melody = parseStringToEndKeepCase(Line, 3);

// The semicolon may appear several times in a RTTTL melody
// Thus only check if it is part of the 1st argument.
if (parseString(Line, 2).indexOf(':') != -1) {
// Apparently this is still using the 'old' (incorrect) syntax:
// rtttl,<gpio><rtttl string>
melody = parseStringToEndKeepCase(Line, 2);
}
String melody = parseStringToEndKeepCase(Line, 2);
melody = melody.substring(melody.indexOf(':'), melody.length());

melody.replace('-', '#');
melody.replace('_', '#');

Expand Down

0 comments on commit 94e1d91

Please sign in to comment.