Show the firmware's reset-cause name in the gimbal view too, not just the dump
This commit is contained in:
parent
575e3c590b
commit
c2a2459f81
|
|
@ -992,9 +992,18 @@ Element gimbalDetailPanel(const GimbalView& g, const DumpView& dump, const Calib
|
||||||
return nullptr;
|
return nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::string reset;
|
// The firmware's own name for the reset cause wins. reset_flags is an AVR
|
||||||
|
// MCUSR bit decode, and on the RP2040 that field is getResetReason() - a
|
||||||
|
// plain enum - so decoding it as bits showed every post-flash soft reset here
|
||||||
|
// as "PORF (power-on) EXTRF (external)". Only the board knows its encoding.
|
||||||
|
std::string reset = d.reset_text;
|
||||||
|
if (reset.empty()) {
|
||||||
for (size_t i = 0; i < d.reset_flags.size(); ++i)
|
for (size_t i = 0; i < d.reset_flags.size(); ++i)
|
||||||
reset += (i ? " " : "") + d.reset_flags[i];
|
reset += (i ? " " : "") + d.reset_flags[i];
|
||||||
|
// Firmware predating `reset=`: the decode is an assumption, so say so
|
||||||
|
// rather than presenting it as fact.
|
||||||
|
if (!reset.empty()) reset += "?";
|
||||||
|
}
|
||||||
std::string calib_note = "calibration from config";
|
std::string calib_note = "calibration from config";
|
||||||
if (calib.has) {
|
if (calib.has) {
|
||||||
long long now = std::chrono::duration_cast<std::chrono::milliseconds>(
|
long long now = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue