That'll be it. As soon as the address it retrieved the data is freed and then it gets overwritten by the next allocated variable!
I'd also add a check to make sure that E.getAddressOf is returning as nonzero value. If for some reason the array isn't allocated in one chunk then getAddressOf won't return a pointer to it, and you don't want to be trying to dereference a null pointer in C.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
That'll be it. As soon as the address it retrieved the data is freed and then it gets overwritten by the next allocated variable!
I'd also add a check to make sure that
E.getAddressOf
is returning as nonzero value. If for some reason the array isn't allocated in one chunk then getAddressOf won't return a pointer to it, and you don't want to be trying to dereference a null pointer in C.