- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello all.
In my isr_1.c file, I wish (for various reasons) to assign a pointer to a specific spot in the SRAM.
What I'm doing is calculating an index (based on the number of times I've entered the ISR) and adding that to a static base address, as in:
uint16 offset;
uint8 *foo;
foo = 0x20000000 + offset;
The complier issues a warning, stating that I'm creating a pointer from an int without a cast.
Is there a more "elegant" or "kosher" way to do this? I am intentionally putting things into this portion of SRAM in order to avoid conflicting with anything related to program execution.
Your thoughts are appreciated, thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You forgot to mention in which of the three worlds you live: PSoC 1, PSoC3 or PSoC5.
for PSoC3 a solution could be:
CYXDATA char MyMem[1 ] _at_ 0x2000;
and later on:
for(ii=0;ii<1000;MyMem[ii++]=0);
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, the above post lacks some information.
This should work for PSoC3 and 5
CYXDATA *MyMem = (void *)0x2000; // With initialization
Bob