Function with variable parameters in viper emitter
Posted: Thu Oct 18, 2018 1:36 pm
Hi.
I want to write a function, that can either read or write directly to memory.
It should have variable parameters, so that:
Writes to memory, while
reads from memory.
The problem is, to be able to access the memory directly, I have to use @micropython.viper, to be able to use pointers.
Does anybody know how to write such a function? As I'm in viper, I obviously can't check a parameter for being 'none', and I've got no idea how to do it in another way.
Thanks in advance.
I want to write a function, that can either read or write directly to memory.
It should have variable parameters, so that:
Code: Select all
mem32(address, data)
Code: Select all
result = mem32(address)
The problem is, to be able to access the memory directly, I have to use @micropython.viper, to be able to use pointers.
Does anybody know how to write such a function? As I'm in viper, I obviously can't check a parameter for being 'none', and I've got no idea how to do it in another way.
Thanks in advance.