In my built-in c program, I have a structure:
struct var{
unsigned long value;
unsigned long length;
+ More
}
An array of these structures is used to store variables. Most of the stored variables are simply stored in the "value", so the length is 1.
However, some of these variables are arrays, and I'm trying to save the starting address in the "value".
unsigned long lookup[10];
variables[x].length = 10;
Then I'm not quite sure how to save the address ...
variables[x].value = lookup;
OR
variables[x].value = (unsigned long)lookup;
I can just discard and add a pointer variable to the structure
EDIT:
I did not want to add a pointer to the structure because I would have to go back and rewrite the read / write functions of the flash memory to save the pointer. They are quite complex and currently work, so I don’t want to touch them!