|
Re: Memory.staticPlace() problem [message #524390 is a reply to message #524156] |
Wed, 31 March 2010 18:59  |
Sasha Slijepcevic Messages: 115 Registered: July 2009 |
Senior Member |
|
|
Tomasz,
the documentation for Memory.staticPlace does not state clearly that you can pass only typed array object as the first parameter.
When you specify:
s = new Array(1.2, 3.4);
Memory.staticPlace(s, 0, null);
you would expect that the result of that code is following C code:
const <SomeType> s = {1.2, 3.4};
However, from the config code above, it can't be determined what do you want the type of the elements in the array to be. Even if the type were determined somehow, you couldn't really access that array from your C code because 's' is just an XDCscript variable, which is not declared in any C file.
If in your XDC specification for module ModA, you have:
module ModA {
config Double[] s;
...
}
then in your configuration script, you could write:
ModA.s = [1.2, 3.4];
Memory.staticPlace(ModA.s, 0, null);
and then you access the array in your C code as Mod_s.
|
|
|
Powered by
FUDForum. Page generated in 0.01846 seconds