|
|
View previous topic :: View next topic |
Author |
Message |
Peter Guest
|
#int_ext and, inline and "Different Levels of Indirecti |
Posted: Sat Aug 11, 2007 5:07 pm |
|
|
Hello there.
I'm fooling around PIC16F684 and when trying to implement the interrupt #int_ext , compiler says about different levels of indirection.
Let's say the code looks as follows:
void doSth(int& data)
{
data= ...... ;
}
#int_ext
void myfunc1(void)
{
int i;
for (i=4; i--;)
doSth(dataOne[i], 8); // <== different levels of indirection!!!
}
I also have noticed that doSth is treated by CCS compiler like an inline function (just in scope of myFunc1). This is - I guess - the source of the issue. How to overcome this? I could give up on this loop and call doSth 4 times, but it takes each time a huge chunk of the program memory that I'm getting short of!
Cheers,
Peter. |
|
|
Peter Guest
|
#int_ext and, inline and "Different Levels of Indirecti |
Posted: Sat Aug 11, 2007 6:06 pm |
|
|
Just forgotten, when passing pointer rather than a reference, the same thing happens! So the following doesn't work:
void doSth(int* pdata, int secondpar)
{
*pdata= ...... ;
} |
|
|
Peter Guest
|
#int_ext and, inline and "Different Levels of Indirecti |
Posted: Sat Aug 11, 2007 6:13 pm |
|
|
Right, false alarm! Sorry. Checked this code once more and this was owing to a reference parameter as expected!
Cheers,
Peter. |
|
|
|
|
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
|
Powered by phpBB © 2001, 2005 phpBB Group
|