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

esp32/machine_rtc: ESP32 machine.RTC().usermem() returning a bytearray. #7133

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

karfas
Copy link

@karfas karfas commented Apr 19, 2021

Returns a bytearray referencing the user memory area of an ESP32 RTC.

This somewhat overlaps with RTC().memory(), but allows to address the entire user memory (e.g. using the uctypes functions) without knowing the exact address of the user memory area.

I would have preferred to create an attribute/property (e.g. RTC().usermem) for this, but that is way too complicated in the C API.

Previous:

mem = uctypes.bytearray_at(0x50000200, 2048) # user needs to know address + size
uctypes.addressof(RTC().memory())                     # address completely unrelated to RTC memory

Afterwards:

mem = machine.RTC().usermem()     # no need to consult source and linker map
addr = uctypes.addressof(mem)         # REAL address of RTC memory

@karfas karfas changed the title esp32/machine_rtc: machine.RTC().usermem() returns bytearray esp32/machine_rtc: ESP32 machine.RTC().usermem() returns bytearray Apr 19, 2021
@karfas karfas changed the title esp32/machine_rtc: ESP32 machine.RTC().usermem() returns bytearray esp32/machine_rtc: ESP32 machine.RTC().usermem() returning a bytearray. Apr 19, 2021
@karfas
Copy link
Author

karfas commented May 23, 2021

Added documentation. This hijacks PR #5199, where machine.RTC.memory() is documented.

@karfas karfas closed this Jan 22, 2022
@karfas karfas deleted the esp32_rtc_usermem branch January 22, 2022 20:36
@karfas karfas restored the esp32_rtc_usermem branch January 22, 2022 20:45
@karfas karfas reopened this Jan 22, 2022
tannewt pushed a commit to tannewt/circuitpython that referenced this pull request Nov 16, 2022
@karfas
Copy link
Author

karfas commented Apr 23, 2023

@jimmo, @dpgeorge: This is now two years old.
Maybe you find time for a review ?

Signed-off-by: Thomas Wenrich <karfas@gmail.com>
@projectgus
Copy link
Contributor

This is an automated heads-up that we've just merged a Pull Request
that removes the STATIC macro from MicroPython's C API.

See #13763

A search suggests this PR might apply the STATIC macro to some C code. If it
does, then next time you rebase the PR (or merge from master) then you should
please replace all the STATIC keywords with static.

Although this is an automated message, feel free to @-reply to me directly if
you have any questions about this.

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

Successfully merging this pull request may close these issues.

None yet

5 participants