MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Wed Sep 16, 2015 7:36 am Post subject: |
|
|
mariofer wrote: | B = myconstarr(myref) ' B = 57[/code] |
Likely a:
Code: | B = LOOKUP( myref, label)
'...
label:
Data 1, 2, 3, 4 |
will do. It will read the indexed value from flash and won't use up SRam for the array, like this:
Code: | const unsigned char pippo[]={1,2,3,4,5,6,7,8...} |
will do.
However Lookup is slower than SRam access, if you need faster access to an initialized SRam array like this C-line, then fill the array with Reads in a loop, after you did a Restore to the label. |
|