~aleteoryx/muditaos

a4125d001e1fdd26ee0db22b3c8800943eb745e4 — Lucjan Bryndza 4 years ago 90e7a48
[EGD-7290] RTC accuracy fix

Add RTC calibration value tweak according to the
measurements from the electronic team.
1 files changed, 5 insertions(+), 2 deletions(-)

M module-bsp/board/rt1051/bsp/rtc/rtc.cpp
M module-bsp/board/rt1051/bsp/rtc/rtc.cpp => module-bsp/board/rt1051/bsp/rtc/rtc.cpp +5 -2
@@ 20,10 20,13 @@ namespace bsp::rtc
{
    ErrorCode init(xQueueHandle qHandle)
    {
        qHandleRtcIrq = qHandle;

        static constexpr auto RTC_CALIBRATION_VALUE = 6;
        qHandleRtcIrq                               = qHandle;
        CLOCK_EnableClock(kCLOCK_SnvsLp);
        SNVS_HP_RTC_GetDefaultConfig(&s_rtcConfig);

        s_rtcConfig.rtcCalValue  = RTC_CALIBRATION_VALUE;
        s_rtcConfig.rtcCalEnable = true;
        SNVS_HP_RTC_Init(SNVS, &s_rtcConfig);

        SNVS_LPCR_LPTA_EN(1);