AP_HAL_SITL: log watchdog reset

This commit is contained in:
Peter Barker 2019-05-15 16:55:05 +10:00 committed by Andrew Tridgell
parent f5190d1bcc
commit 0a3fe32209
1 changed files with 12 additions and 0 deletions

View File

@ -152,6 +152,18 @@ void HAL_SITL::run(int argc, char * const argv[], Callbacks* callbacks) const
callbacks->setup();
scheduler->system_initialized();
if (getenv("SITL_WATCHDOG_RESET")) {
const AP_HAL::Util::PersistentData &pd = util->persistent_data;
AP::logger().WriteCritical("WDOG", "TimeUS,Task,IErr,IErrCnt,MavMsg,MavCmd,SemLine", "QbIIHHH",
AP_HAL::micros64(),
pd.scheduler_task,
pd.internal_errors,
pd.internal_error_count,
pd.last_mavlink_msgid,
pd.last_mavlink_cmd,
pd.semaphore_line);
}
bool using_watchdog = AP_BoardConfig::watchdog_enabled();
if (using_watchdog) {
signal(SIGALRM, sig_alrm);