How to generate a MicroPython QSTR from a C macro?

50 views Asked by At

I'm using MicroPython and I would like to generate a QSTR that contains the contents of a macro. For example, I have the following macro:

#define MY_MACRO "hello"

How can I generate a QSTR that has the value "hello" and is called MP_QSTR_MY_MACRO?

When I use MP_QSTR_MY_MACRO, that QSTR contains "MY_MACRO" instead of "hello".

0

There are 0 answers