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

mbedtls: avoid function that only exists on rp2040 #9792

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

jepler
Copy link
Member

@jepler jepler commented Nov 5, 2024

rp2350 doesn't have the same RTC peripheral as the 2040 (let alone other family micros), as reported on discord by anecdata.

this has the side effect of obeying a different timesource if one has been configured.

This only compile-tested (for pico w and for pico 2 with SSL module enabled). I didn't actually run the code.

@anecdata please test if you can.

rp2350 doesn't have the same RTC peripheral as the 2040 (let alone
other family micros)

this has the side effect of obeying a different timesource if one has
been configured.
Copy link
Member

@anecdata anecdata left a comment

Choose a reason for hiding this comment

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

Tested Requests on:

  • Pico W, SSL over wifi
  • WIZnet W5500 EVB Pico, SSL over Ethernet
  • Pico2 (WIZnet W5100S EVB Pico2 - RP2350), but without SSL, over Ethernet

Looks good to me, thank you!

(I'll test Pico2 with SSL over Ethernet on my WIZnet W5100S EVB Pico2 PR #9791)

edit: not sure what "obeying a different timesource if one has been configured" implies but time.localtime() behaves as expected when used with default CPU time and with RTC source set to NTP:

print(f'{time.localtime()}')
ntp = adafruit_ntp.NTP(pool)
rtc.set_time_source(ntp)
print(f'{time.localtime()}')

after a reset yields:

struct_time(tm_year=2000, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=0, tm_sec=12, tm_wday=5, tm_yday=1, tm_isdst=-1)
struct_time(tm_year=2024, tm_mon=11, tm_mday=5, tm_hour=2, tm_min=15, tm_sec=42, tm_wday=1, tm_yday=310, tm_isdst=-1)

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

Thanks for the fix and the review!

@dhalbert dhalbert merged commit 6cb7c82 into adafruit:main Nov 5, 2024
562 checks passed
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