Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: getAlarmEpoch() #67

Open
sergerold opened this issue Jan 5, 2021 · 0 comments · May be fixed by #82
Open

Suggestion: getAlarmEpoch() #67

sergerold opened this issue Jan 5, 2021 · 0 comments · May be fixed by #82
Labels
type: enhancement Proposed improvement

Comments

@sergerold
Copy link

sergerold commented Jan 5, 2021

Hi

I noticed that there is no 'getAlarmEpoch()' method. I have implemented in my own sketch but it may be worthwhile adding to the library.

uint32_t getAlarmEpoch()
        {
            struct tm alarmTime;
            
            alarmTime.tm_isdst = -1;
            alarmTime.tm_yday = 0;
            alarmTime.tm_wday = 0;
            alarmTime.tm_year = pRtcAlarm->getAlarmYear() + EPOCH_TIME_YEAR_OFF;
            alarmTime.tm_mon = pRtcAlarm->getAlarmMonth() - 1;
            alarmTime.tm_mday = pRtcAlarm->getAlarmDay();
            alarmTime.tm_hour = pRtcAlarm->getAlarmHours();
            alarmTime.tm_min = pRtcAlarm->getAlarmMinutes();
            alarmTime.tm_sec = pRtcAlarm->getAlarmSeconds();
            
            return mktime(&alarmTime);
}

Thanks

@per1234 per1234 added the type: enhancement Proposed improvement label Jan 5, 2021
JeromeBriot added a commit to JeromeBriot/RTCZero that referenced this issue Jan 7, 2022
Fix warning on compiling with oldTime.RTC_MODE2_CLOCK_Type::reg (arduino-libraries#67)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Proposed improvement
Projects
None yet
2 participants