Skip to content

feat(swan_r5): adds a basic STM32 RTC implementation. #6468

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

Merged
merged 3 commits into from
Jun 13, 2022

Conversation

m-mcgowan
Copy link

This adds a simple STM32 implementation of the Real Time Clock.

Testing

This test script outputs the current time every second, via both the RTC and time.time().

import time
import rtc

r = rtc.RTC()
r.datetime = time.struct_time((2022, 6, 13, 3, 4, 5, -1, -1, -1))

while True:
    print(r.datetime)
    time.sleep(1)
    print(time.time())

@tannewt
Copy link
Member

tannewt commented Jun 8, 2022

Looks like the build failed because I moved translate.h on you. It is now #include "supervisor/shared/translate/translate.h". Would you mind turning RTC on for all STM builds it will work with?

@m-mcgowan
Copy link
Author

Looks like the build failed because I moved translate.h on you. It is now #include "supervisor/shared/translate/translate.h". Would you mind turning RTC on for all STM builds it will work with?

I've fixed up the include locally, and swan_r5 builds. But I'm seeing build errors on other stm boards after pulling in main

In file included from ../../py/obj.h:33,
                 from ../../shared-module/displayio/Palette.h:33,
                 from ../../shared-bindings/displayio/Palette.h:30,
                 from build-stm32f4_discovery/autogen_display_resources-en_US.c:2:
../../py/qstr.h:42:14: fatal error: genhdr/qstrdefs.enum.h: No such file or directory
     #include "genhdr/qstrdefs.enum.h"
              ^~~~~~~~~~~~~~~~~~~~~~~~

This is with a clean build. Any thoughts what might be the cause here?

EDIT: It looks like it has something to do with parallel builds and the -j option to make.

@tannewt
Copy link
Member

tannewt commented Jun 13, 2022

This is with a clean build. Any thoughts what might be the cause here?

I think we're missing a dependency in our Makefile and the -j leads to a race condition. It's not an issue with your code. (It's a change I made.)

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Thank you!

@tannewt tannewt merged commit ab346a2 into adafruit:main Jun 13, 2022
@dhalbert dhalbert mentioned this pull request Oct 28, 2023
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.

2 participants