AP_BoardConfig: add and use an AP_RTC_config.h

This commit is contained in:
Peter Barker 2023-10-04 18:03:32 +11:00 committed by Andrew Tridgell
parent fdcd13746d
commit 6dc80006d3
2 changed files with 7 additions and 1 deletions

View File

@ -238,9 +238,11 @@ const AP_Param::GroupInfo AP_BoardConfig::var_info[] = {
// @User: Standard
AP_GROUPINFO("SAFETYOPTION", 13, AP_BoardConfig, state.safety_option, BOARD_SAFETY_OPTION_DEFAULT),
#if AP_RTC_ENABLED
// @Group: RTC
// @Path: ../AP_RTC/AP_RTC.cpp
AP_SUBGROUPINFO(rtc, "RTC", 14, AP_BoardConfig, AP_RTC),
#endif
#if HAL_HAVE_BOARD_VOLTAGE
// @Param: VBUS_MIN
@ -378,7 +380,9 @@ void AP_BoardConfig::init()
board_setup();
#if AP_RTC_ENABLED
AP::rtc().set_utc_usec(hal.util->get_hw_rtc(), AP_RTC::SOURCE_HW);
#endif
if (_boot_delay_ms > 0) {
uint16_t delay_ms = uint16_t(_boot_delay_ms.get());

View File

@ -279,8 +279,10 @@ private:
AP_Radio _radio;
#endif
#if AP_RTC_ENABLED
// real-time-clock; private because access is via the singleton
AP_RTC rtc;
#endif
#if HAL_HAVE_BOARD_VOLTAGE
AP_Float _vbus_min;