Problem with jumping from a function to another and back again

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem with jumping from a function to another and back again

Jump to solution
2,422 Views
admin
Specialist II

Hi. Below are 2 functions:

 

byte self_test(void)
    {   
        ...

        ...

        testing();
    }
 

 

byte testing(void)
    {   
        ...

        ...

        self_test();
    }

 

From the testing function, I'm able to jump to the self_test function since the self_test function is declared above the testing function. However, I'm unable to jump to the testing function if I'm in the self_test function because the testing function is declared below the self_test function. Anyone knows a way to jump between these 2 functions continuously? Thx :smileyhappy:

Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
881 Views
kef
Specialist I

Do you mean compiler produces warnings or doesn't compile at all because of missing testing() prototype? Then add it above self_test(): 

 

byte testing(void);

 

View solution in original post

0 Kudos
Reply
6 Replies
882 Views
kef
Specialist I

Do you mean compiler produces warnings or doesn't compile at all because of missing testing() prototype? Then add it above self_test(): 

 

byte testing(void);

 

0 Kudos
Reply
881 Views
admin
Specialist II

kef wrote:

Do you mean compiler produces warnings or doesn't compile at all because of missing testing() prototype? Then add it above self_test(): 

 

byte testing(void);

 


 

Thx for the reply. The compiler cannot compile at all because it cannot find testing(). And if I put testing() above self_test(), then the compiler will not be able to find self_test(). Therefore I'm only able to jump from one function to the other, but not vice versa.. lol. I've tried inserting "byte testing(void);" above self_test(). But the compiler still cannot compile 
0 Kudos
Reply
881 Views
Lundin
Senior Contributor IV
If prototypes doesn't solve it, the problem is related to something else. Post the code.
0 Kudos
Reply
881 Views
admin
Specialist II

Lundin wrote:
If prototypes doesn't solve it, the problem is related to something else. Post the code.

Here's the portion I added. I inserted "byte testing(void);" above self_test(), but it still doesn't compile 

 

byte testing(void); 

 

byte self_test(void)
    {   
        ...

        ...

        testing();
    }
 

 

byte testing(void)
    {   
        ...

        ...

        self_test();
    }

0 Kudos
Reply
881 Views
stanish
NXP Employee
NXP Employee

Cryptical,

 

What does the complier reports? Can you post here the compiler error message? I guess the problem is somewhere else.


Stanish

 

0 Kudos
Reply
881 Views
admin
Specialist II

stanish wrote:

Cryptical,

 

What does the complier reports? Can you post here the compiler error message? I guess the problem is somewhere else.


Stanish

 


 

Hi. I've tested kef's method again. Now it works. I don't know what went wrong before. Lol. Thx for the help guys :smileyhappy:
0 Kudos
Reply