Added WCH-Link alternative firmware version to logs

This commit is contained in:
Nav
2025-02-02 16:16:10 +00:00
parent a9c8f24f8b
commit ac8b5d50fc
2 changed files with 8 additions and 1 deletions

View File

@@ -15,6 +15,10 @@ namespace DebugToolDrivers::Wch
return std::to_string(this->major) + "." + std::to_string(this->minor);
}
[[nodiscard]] std::string toAlternativeString() const {
return "v" + std::to_string(this->major * 10 + this->minor);
}
bool operator == (const WchFirmwareVersion& other) const {
return this->major == other.major && this->minor == other.minor;
}

View File

@@ -92,7 +92,10 @@ namespace DebugToolDrivers::Wch
);
}
Logger::info("WCH-Link firmware version: " + deviceInfo.firmwareVersion.toString());
Logger::info(
"WCH-Link firmware version: " + deviceInfo.firmwareVersion.toString() + " ("
+ deviceInfo.firmwareVersion.toAlternativeString() + ")"
);
}
bool WchLinkBase::isInitialised() const {