I am new in Cython and I have a problem compiling an inline function. The simplified code is:
cdef inline REG8(ulong addr):
(<volatile_uchar_ptr *>(addr))[0]
I am trying to use the inline function inside a Python method:
def test(self):
REG8(addr) = 0x08 # ==> Error: "Cannot assign or delete this".
(<volatile_uchar_ptr *>(addr))[0] = 0x08 # ==> OK.
When I use the inline function REG8(), I get the compiler error:
Cannot assign or delete this. However, the inserted code will work. I have no clue what is wrong here and will appreciate any help.
You missed a [0]:
REG8(addr)[0] = 0x08
You were assigning to a function call, not the value it points to.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With