MP_QSTR_ not recognized
Posted: Fri Nov 18, 2016 2:07 am
I was just playing around with the code (particularly, a port to the EDU-CIAA https://github.com/micropython/micropython/pull/1732)
and I saw that the SPI code was not compliant with the official documentation so I started to modify it.
The problem is that some MP_QSTR_ definitions are missing (from the new code)
modpybspi.c:68:11: error: 'MP_QSTR_polarity' undeclared (first use in this function)
{ MP_QSTR_polarity, MP_ARG_KW_ONLY | MP_ARG_INT , {.u_int = 1} },
I used stmhal/spi.c as a reference and basically took a copy of the way you handle the function arguments:
pyb_spi_init_helper(const pyb_spi_obj_t *self, mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static const mp_arg_t allowed_args[] = {
...
{ MP_QSTR_polarity, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1} },
...
I know there is a task to create "qstrdefs.generated.h". Somehow I'm missing that task from the port, and some of the MP_QSTR_ definitions are missing as a result.
Any hints on how to proceed?
Thank you.
and I saw that the SPI code was not compliant with the official documentation so I started to modify it.
The problem is that some MP_QSTR_ definitions are missing (from the new code)
modpybspi.c:68:11: error: 'MP_QSTR_polarity' undeclared (first use in this function)
{ MP_QSTR_polarity, MP_ARG_KW_ONLY | MP_ARG_INT , {.u_int = 1} },
I used stmhal/spi.c as a reference and basically took a copy of the way you handle the function arguments:
pyb_spi_init_helper(const pyb_spi_obj_t *self, mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static const mp_arg_t allowed_args[] = {
...
{ MP_QSTR_polarity, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1} },
...
I know there is a task to create "qstrdefs.generated.h". Somehow I'm missing that task from the port, and some of the MP_QSTR_ definitions are missing as a result.
Any hints on how to proceed?
Thank you.