Skip to content

Commit

Permalink
Merge pull request #184 from nlesc-recruit/fix-fw-version-read
Browse files Browse the repository at this point in the history
Re-add sending newline in FW version from device; remove it on the host
  • Loading branch information
loostrum authored Nov 18, 2024
2 parents a6d65bf + 8b1de8e commit 3d3e8b0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions device/PowerSensor/PowerSensor.ino
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,11 @@ void serialEvent() {
break;
case 'V':
// Send firmware version in human-readable format
Serial.print(VERSION);
#ifdef DEMO
Serial.print("-DEMO");
Serial.print(VERSION);
Serial.println("-DEMO");
#else
Serial.println(VERSION);
#endif
break;
case 'Z':
Expand Down
2 changes: 2 additions & 0 deletions host/src/PowerSensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,8 @@ std::string PowerSensor::getVersion() {
c = readCharFromDevice();
version += c;
}
// remove newline from version string
version.pop_back();
startIOThread();
return version;
}
Expand Down

0 comments on commit 3d3e8b0

Please sign in to comment.