Skip to content

micropython port micro:bit v2 : Please add item assignment / referencing to global static memory blocks via bytearray() and memoryview() #13185

Answered by burksfamly
burksfamly asked this question in nRF
Discussion options

You must be logged in to vote

micro:bit help desk reached out to me to let me know what was not supported and what was supported as follows:

------------------------------------------
what is supported and not supported
------------------------------------------

a = bytearray(b'0123456789')

a[0:3] = b'jkl'           ...not supported

m = memoryview(a)
m[0:3] = b'jkl'          ...not supported

a[0] = b'j'                ...supported
a[1] = b'k'
a[2] = b'l'
------------------------------------------
The following is what I was looking for...the buffers are instantiated once and not moved around by micropython operations.
------------------------------------------

_rx_buffer = bytearray(64)
_mv_rx_buffer = memoryvie…

Replies: 6 comments 18 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@burksfamly
Comment options

Comment options

andrewleech
Dec 12, 2023
Collaborator Sponsor

You must be logged in to vote
2 replies
@burksfamly
Comment options

@burksfamly
Comment options

Answer selected by burksfamly
Comment options

You must be logged in to vote
1 reply
@burksfamly
Comment options

Comment options

You must be logged in to vote
13 replies
@burksfamly
Comment options

@rkompass
Comment options

@rkompass
Comment options

@rkompass
Comment options

@burksfamly
Comment options

Comment options

You must be logged in to vote
1 reply
@rkompass
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
nRF
Labels
None yet
6 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy