logger: fixed watchdog not logging, increased cycle trigger (#23769)

This commit is contained in:
Alexander Lerach
2024-10-08 09:53:55 +02:00
committed by GitHub
parent fd04ece6d4
commit 936eb89edb
3 changed files with 19 additions and 4 deletions
+12 -1
View File
@@ -1615,6 +1615,11 @@ void Logger::initialize_load_output(PrintLoadReason reason)
{
// If already in progress, don't try to start again
if (_next_load_print != 0) {
// To never miss watchdog triggers due to load measuring in progress, overwrite the measurement reason
if (reason == PrintLoadReason::Watchdog) {
_print_load_reason = reason;
}
return;
}
@@ -1635,7 +1640,13 @@ void Logger::write_load_output()
_writer.set_need_reliable_transfer(true, _print_load_reason != PrintLoadReason::Watchdog);
if (_print_load_reason == PrintLoadReason::Watchdog) {
PX4_ERR("Writing watchdog data"); // this is just that we see it easily in the log
// This is just that we see it easily in the log
PX4_ERR("Writing watchdog data...");
#ifdef __PX4_NUTTX
bool cycle_trigger = _timer_callback_data.watchdog_data.triggered_by_cycle_delay;
bool ready_trigger = _timer_callback_data.watchdog_data.triggered_by_ready_delay;
PX4_ERR("Watchdog triggers - cycle trigger: %d, ready trigger: %d", cycle_trigger, ready_trigger);
#endif
write_perf_data(PrintLoadReason::Watchdog);
}