Skip to content

Commit

Permalink
AP_Scheduler: log RTC into PM message
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker authored and tridge committed Nov 20, 2024
1 parent bd0d4f9 commit 5647141
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libraries/AP_Scheduler/AP_Scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,11 @@ void AP_Scheduler::update_logging()
// Write a performance monitoring packet
void AP_Scheduler::Log_Write_Performance()
{
uint64_t rtc = 0;
#if AP_RTC_ENABLED
UNUSED_RESULT(AP::rtc().get_utc_usec(rtc));
#endif

const AP_HAL::Util::PersistentData &pd = hal.util->persistent_data;
struct log_Performance pkt = {
LOG_PACKET_HEADER_INIT(LOG_PERFORMANCE_MSG),
Expand All @@ -464,6 +469,7 @@ void AP_Scheduler::Log_Write_Performance()
i2c_count : pd.i2c_count,
i2c_isr_count : pd.i2c_isr_count,
extra_loop_us : extra_loop_us,
rtc : rtc,
};
AP::logger().WriteCriticalBlock(&pkt, sizeof(pkt));
}
Expand Down

0 comments on commit 5647141

Please sign in to comment.