How can I use those constant arrays as parameters for a function?
void function(int32 *aux);
writing
function(array_rom1);
complirer doesn't report any error but the data are wrong
thank you
Ttelmah
Joined: 11 Mar 2010 Posts: 19928
Posted: Fri Jul 25, 2025 2:00 am
What chip?.
It makes a huge difference.
What compiler version?.
Also makes a difference.
The big problem here is trying to use a pointer to ROM. This has been
discussed here many times. The point is that pointers are to the RAM, and
this is a different memory space to the ROM. This is fundamental to the
PIC's Harvard architecture,
You are telling the routine you are passing a pointer to RAM.
Have a look at this thread:
[url]
https://www.ccsinfo.com/forum/viewtopic.php?t=35864
[/url]
You can also switch how const is handled.#DEVICE CONST=ROM, will
make const declarations be handled like ROM declarations.
On the 16bit PIC's you can create a window between the ROM and RAM.
This is 'PSV'. can be enabled with #device.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum