plz  explain this.. #define statement - mc1321x  ZigBee

cancel
Showing results for 
Search instead for 
Did you mean: 

plz  explain this.. #define statement - mc1321x  ZigBee

973 Views
kanu
Contributor I

me a starter in embedded programming, i m trying to understand the start code for mc1321x based SRBboard, i amnot able to figure out the use of two parenthesis

specifically this part- } _FEED_COP(); __asm {

as in the following statement.this is from start08.c .

----------------------------------------------!--------------------------------!
#define __FEED_COP_IN_HLI() } _FEED_COP(); __asm {
regards.. karan

Message Edited by kanu on 2008-10-19 10:37 PM

Message Edited by kanu on 2008-10-19 10:38 PM

Message Edited by kanu on 2008-10-19 10:41 PM

 

 

Added p/n to subject.



Message Edited by NLFSJ on 2008-10-20 10:31 AM
Labels (1)
0 Kudos
2 Replies

44 Views
kanu
Contributor I
i got that..
thanx daniel... thnxx a lot..



regards...
karan
0 Kudos

44 Views
CompilerGuru
NXP Employee
NXP Employee
Look how the macro is used:


Code:
  asm {
...
             AIX    #1
             __FEED_COP_IN_HLI()      ; // it's necessary to feed the COP in the inner loop for the fast COP timeout of some derivatives
Zero_0:
             DBNZA  Zero_2
.....
  }

The _FEED_COP cannot be used in a HLI, its written so that it has to be called in a C code area.
Therefore the  __FEED_COP_IN_HLI macro first closes the open asm { block with a single brace },
the
 __asm {
part at the end reopens the HLI block again.

Note that the __FEED_COP_IN_HLI macro is defined in a C file for a particular usage,
for the general (C code) case, use the _FEED_COP macro.

If you do not understand how in C a particular macro works, I would suggest to check the generated preprocessor output.

Daniel
0 Kudos