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 a delay after rtc_set_datetime #2156

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

peterharperuk
Copy link
Contributor

If you call rtc_get_datetime immediately after rtc_set_datetime you get junk back. According to the datasheet "Writing to the RTC will take 2 clk_rtc clock periods to arrive". So add a delay after calling rtc_set_datetime in aon_timer_set_time_calendar.

Fixes #2148

If you call rtc_get_datetime immediately after rtc_set_datetime you get
junk back. According to the datasheet "Writing to the RTC will take
2 clk_rtc clock periods to arrive". So add a delay after calling
rtc_set_datetime in aon_timer_set_time_calendar.

Fixes raspberrypi#2148
struct tm tm = { 0 };
struct tm tm_check = { 0 };

tm.tm_sec = 55;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that this test will probably take much less than 5 seconds to run, but given that the checking-code below is checking for tm_sec rollover but isn't checking for tm_min rollover, perhaps it makes sense to set the tm_sec to something like 15 rather than 55 ? 😉

@lurch
Copy link
Contributor

lurch commented Jan 3, 2025

ping @armandomontanez - any idea why the CMake build is passing but the Bazel build is failing?

@armandomontanez
Copy link
Contributor

armandomontanez commented Jan 5, 2025

Looks like you need to add //src/rp2_common/pico_aon_timer to the deps of the test. You also might need to add //src/common/pico_time to the deps of pico_aon_timer since it's pulling in a new header. If you hit another snag let me know and I'll cook up a diff to get it working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants