Add DAB ANTCAP calibration and fix BT1035 boot banner timing
Extend the FM-only ANTCAP antenna-varactor override to DAB, mirroring the existing mechanism end to end (driver, tuner, service, EEPROM storage, HTTP API). Live sweep on real hardware found no ANTCAP value beating auto-tune on the ensembles tested, so DAB stays on auto-tune by default. Also fix BT1035 boot: the module's real boot banner doesn't appear until ~18-24s after RESET# releases, not the 3.5s previously waited; add a 2-attempt retry and a baud-rate probe fallback for diagnostics. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -203,6 +203,10 @@ std::expected<TunerTuneRequest, ParseError> parseTunerTuneJson(
|
||||
} else {
|
||||
return std::unexpected(ParseError::InvalidJson);
|
||||
}
|
||||
unsigned long antCap = 0U;
|
||||
if (extractJsonUint(json, "antcap", antCap) && antCap <= 128U) {
|
||||
req.antCap = static_cast<std::uint8_t>(antCap);
|
||||
}
|
||||
return req;
|
||||
}
|
||||
|
||||
@@ -336,4 +340,28 @@ std::string serializeTunerFmBandScanJson(
|
||||
return out.str();
|
||||
}
|
||||
|
||||
std::expected<AntennaCalibrationRequest, ParseError>
|
||||
parseAntennaCalibrationJson(std::string_view json)
|
||||
{
|
||||
if (json.find('{') == std::string_view::npos) {
|
||||
return std::unexpected(ParseError::InvalidJson);
|
||||
}
|
||||
unsigned long antCap = 0U;
|
||||
if (!extractJsonUint(json, "antcap", antCap) || antCap > 128U) {
|
||||
return std::unexpected(ParseError::MissingField);
|
||||
}
|
||||
|
||||
AntennaCalibrationRequest req = {};
|
||||
req.antCap = static_cast<std::uint8_t>(antCap);
|
||||
const std::string_view band = extractJsonString(json, "band");
|
||||
if (band == "dab") {
|
||||
req.band = TunerBand::Dab;
|
||||
} else if (band.empty() || band == "fm") {
|
||||
req.band = TunerBand::Fm;
|
||||
} else {
|
||||
return std::unexpected(ParseError::InvalidJson);
|
||||
}
|
||||
return req;
|
||||
}
|
||||
|
||||
} // namespace core
|
||||
|
||||
Reference in New Issue
Block a user