Hi all. I have come across a little oddity in my application that I'm hoping someone here can help shed some light on. I have implemented a bootloader and have used the #reserve and #locate pre-processor directives to keep my bootloader's variables at the same address location between builds. That works fine. The problem comes in when I use the #zero_ram directive. This appears to skip the #locate'd memory areas.
Here is an example:
char ch1;
char ch2;
.
.
.
#zero_ram
#reserve 0xD00:0xEFF
#locate ch1 = 0xD00
#locate ch2 = 0xD01
.
.
.
This snippet will initialize all but the #locate'd memory space.
I guess my question is this: Is there a CCS directive (or a better use of the above directives) that will allow the #locate'd or #reserve'd RAM to be included in the #zero_ram directive's scope or am I stuck writing my own code to accomplish this (which isn't difficult, but shouldn't be necessary)?
BTW: I'm using build 3.187 inside of MPLAB, target is 18F8720
Thank you in advance.
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
Posted: Mon Apr 05, 2004 5:15 pm
Both #locate and #reserve stop the compiler from using that specific memory area. There are ways around it, for example by using #byte instead of #locate. But then this won't stop the compiler from using that memory location. Whether this is acceptable or not depends on your application.
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