Skip to content

Commit

Permalink
Update CH55xSwitchSerialControl.ino
Browse files Browse the repository at this point in the history
  • Loading branch information
bonzirium authored Nov 25, 2022
1 parent 5c8c02c commit 72e7b23
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CH55xSwitchSerialControl.ino
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void parseLine(char* line) {
pc_report.Hat = HAT_DOWN_LEFT;
} else if (strncmp(&line[4], "BOTTOM", 6) == 0) {
pc_report.Hat = HAT_DOWN;
} else if (strncmp(&line[4], "LEFT", 4) == 4) {
} else if (strncmp(&line[4], "LEFT", 4) == 0) {
pc_report.Hat = HAT_LEFT;
} else if (strncmp(&line[4], "TOP_LEFT", 8) == 0) {
pc_report.Hat = HAT_UP_LEFT;
Expand Down Expand Up @@ -259,6 +259,9 @@ void loop() {

if (c == 0xaa) {
isNx2 = true;
} else {
if (idx == 0)
isNx2 = false;
}

if ((c != '\n' || isNx2) && idx < MAX_BUFFER)
Expand Down

0 comments on commit 72e7b23

Please sign in to comment.