-
I know how to add constants of type integer to a class, which can be achieved through the following code: |
Beta Was this translation helpful? Give feedback.
Answered by
jimmo
Aug 15, 2023
Replies: 1 comment 1 reply
-
Same as how you encode the keys -- use If the string can't be encoded into MP_QSTR_ then you'll either need to add it to qstrdefs.h or make a string object from a literal and point to that. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Mars-CN
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Same as how you encode the keys -- use
{ MP_ROM_QSTR(MP_QSTR_STRVAL), MP_ROM_QSTR(MP_QSTR_FooBar ) }
If the string can't be encoded into MP_QSTR_ then you'll either need to add it to qstrdefs.h or make a string object from a literal and point to that.