The way we have decided to handle support is to write C++ drivers for our boards, then write micropython User C Module bindings for them, so the same underling code is shared. We then bundle these bindings in our own fork of Micropython, specifically for the Pico. Whether this approach proves viable long-term remains to be seen, but it was the best option at the time.
Anyway, the reason I'm posting is because whilst writing these bindings I've encountered multiple occasions where I get errors about the QSTR names I provide for functions and keywords. Here's an example:
Code: Select all
/home/users/pico/micropython/ports/rp2/build/frozen_content.c:219:5: error: redeclaration of enumerator 'MP_QSTR_port'
219 | MP_QSTR_port,
| ^~~~~~~~~~~~
In file included from /home/user/pico/micropython/py/obj.h:33,
from /home/user/pico/micropython/py/objint.h:30,
from /home/user/pico/micropython/ports/rp2/build/frozen_content.c:15:
/home/user/pico/micropython/ports/rp2/build/genhdr/qstrdefs.generated.h:820:6: note: previous definition of 'MP_QSTR_port' was here
820 | QDEF(MP_QSTR_port, (const byte*)"\x5c\x04" "port")
Code: Select all
pin
pins
x
y
wrap
loop
host
port
connect
start_server
I was therefore wondering, when I encounter such situations, is there a way for me to reference the existing QSTR so I can use the name instead of providing a new name? Accessing mp_qstr_frozen_const_pool in some way perhaps?
Thanks in advance