> You've got a nice library there, and I suspect it may be pretty fast
> too.
>
> But we'd like more features. :-)
>
> Here are some half-baked ideas.
Idea's are always welcome :)
> 1. A compile-time constant for total max memory usage for large
> arrays is fine.
like I have now?
-- const dword ARRAY_SIZE = 600 -- choose number of array
variables
-- const dword ARRAY_VARIABLE_SIZE = 2 -- choose size of variables
(byte*2)
would take up 600x2 bytes
> 2. We can get by with just your dword-width arrays, and do a little
> index arithmetic and shifting when dealing with byte and word widths
I wanted to make functions with byte*CONSTANT like:
const byte SOME_CONSTANT = 2
function large_array_1'get(byte*SOME_CONSTANT in address) return
byte*SOME_CONSTANT is
but the compiler would not allow me, therefore I had to make 3
seperate functions for byte, word, dword
> 2. We'd like to be able to allocate more than one array, and
> preferably a mix of different widths (byte, word, or dword)
I agree, I wanted to wait for your feedback before I do this. more
arrays would just require renaming variables & copying code, I can add
some but how many? maybe 4? and yes, you would then be able to have a
mix of widths.
> 3. We'd like to do the allocation at run-time, not at compile time:
> var word handle1 = large_byte_array(300)
> var word handle2 = large_byte_array(300)
> var word handle3 = large_word_array(999)
> var word handle4 = large_dword_araay(400)
> notes: we have a mix of byte arrays (handle1 and handle2),
> word array: handle3, and a dword array(handle4)
> yes, the numbers above may be more than your typical 18F ram
> max. They are just for example.
I'm not sure what you are trying to do here. I like having the array
allocated at compile time so it does not take up time/cycles. Using an
array allocated during compile must be faster then using an array
allocated during run time.
I don't know how to allocate an array during run time. I suppose a
different set of arrays could be made for allocating during run time.
Is there a specific reason to allocated during run time?
I suppose you want to create an array while running then delete it and
use the memory space for something else??
> 4. We need a cool way to actually use the 'dynamic' large arrays. No
> ideas yet on that... So until then:
> x = get_large_byte_array(handle1, some_index)
> put_large_byte_array(handle2, some_index, x)
> not nearly so cool as your approach, but we can do more than
> one array, and we can do a mix of arrays.
dynamic meaning an array created during run time? I guess you won't be
able to make it work like a real array: x = get_large_byte_array
[some_index] so that's fine.
> 5. It would be a real 'bonus' if we could 'free' the array after use,
> but that can wait until later. :-)
true
Thanks William, If you would like array's to be created during run
time you may add this feature to the lib. If you do create this
feature, feel free to add your name to the top of the lib as one of
the authors.
During the building of this lib I was only concerned to have an array
(s) that would work like any other array and be as fast as possible
while the circuit is running. I wanted to use only constants and have
no variables for allocating the array. I still wish Kyle would add
large arrays to jalv2, but this works just as well.
Matt.