Skip to content

Commit 7bc8e9b

Browse files
authored
Merge pull request #20 from gpstar81/updates
serial protocol bug check fix
2 parents ec20667 + b4be058 commit 7bc8e9b

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "GPStar Audio Serial Library",
3-
"version": "1.2.1",
3+
"version": "1.2.2",
44
"description": "A serial communication control library for the GPStar Audio and GPStar Audio XL series of audio boards from GPStar Technologies.",
55
"keywords": "audio, serial, music, wav",
66
"authors":

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=GPStar Audio Serial Library
2-
version=1.2.1
2+
version=1.2.2
33
author=Michael Rajotte
44
license=GPL-3.0-or-later
55
maintainer=Michael Rajotte <michael.rajotte@gpstartechnologies.com>

src/GPStarAudio.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,14 @@ void gpstarAudio::update(void) {
8585
}
8686
}
8787
else if((rxCount > 2) && (rxCount < rxLen)) {
88-
if(dat == SOM1 || dat == SOM2 || dat == EOM) {
89-
rxCount = 0; // Bad serial data.
88+
rxMessage[rxCount - 3] = dat;
89+
rxCount++;
90+
91+
if(rxMessage[0] == RSP_GPSTAR_HELLO) {
92+
// Skip the extra check upon the GPStar hello check.
9093
}
91-
else {
92-
rxMessage[rxCount - 3] = dat;
93-
rxCount++;
94+
else if(dat == SOM1 || dat == SOM2 || dat == EOM) {
95+
rxCount = 0; // Bad serial data.
9496
}
9597
}
9698
else if(rxCount == rxLen) {

0 commit comments

Comments
 (0)