how to access a uctypes.struct in a C function?
Posted: Wed Sep 01, 2021 1:09 am
I have a uctypes.struct() structure that I'm holding in an object attribute (called _s) that's being passed to a C function (a timer callback).
In the C function I'm doing this to get the pointer to the structure:
but I'm getting this error message:
What is the correct way to get a structure pointer from this attribute?
In the C function I'm doing this to get the pointer to the structure:
Code: Select all
size_t len;
stepper *s = (stepper *)mp_obj_str_get_data(mp_load_attr(self, MP_QSTR__s), &len);
Code: Select all
uncaught exception in Timer(8) interrupt handler
TypeError: can't convert 'struct' object to str implicitly