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

Add RTC time setting and getting functionality #23

Open
geoffreyottoy opened this issue Feb 17, 2020 · 0 comments
Open

Add RTC time setting and getting functionality #23

geoffreyottoy opened this issue Feb 17, 2020 · 0 comments
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@geoffreyottoy
Copy link

Not really an issues, more of a request. I think it would be handy if we could access the underlying RTC to keep track of the time that has elapsed between e.g. two pin-interrupt wake's.

I propose two methods to achieve this:

void ArduinoLowPowerClass::setRtcTime(uint32_t time){
	// not sure if this is the best way to make sure the RTC is up and running
	if (!rtc.isConfigured()) {
		attachInterruptWakeup(RTC_ALARM_WAKEUP, NULL, 0);
	}

	rtc.setEpoch(time);
}

uint32_t ArduinoLowPowerClass::getRtcTime(void){
	return rtc.getEpoch();
}

I have tested this on SAMD and it seems to be working.

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Oct 19, 2023
@per1234 per1234 changed the title Request for added functionality Add RTC time setting and getting functionality Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

2 participants