Use Device Initialization To generate CODE, How to avoid the code lose?

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

Use Device Initialization To generate CODE, How to avoid the code lose?

2,322 Views
harlenChen
Contributor I
Hello,
I use the Devide Initialization to configure MCU and generate Code. MCUinit.c is created.
Because MCUinit.c have Interrupt function.  Need to tranfer the value between MCUinit.c and  main.c.
So I define the extern arguement.  But  once I  re-generate code, all the definations are lose.
How to cover this problem?
Best regards
harlen
 
Labels (1)
0 Kudos
Reply
2 Replies

594 Views
Alban
Senior Contributor II
Hi,

I don't remember the exact post, but we already talked about that.
If you use the search on the Forum, you will find these posts.

The inconvenient in doing so means that some beans will not be modified and therefore you kind of lose the bean.
But look at the posts, they will be more descriptive.

Cheers,
Alban.
0 Kudos
Reply

594 Views
CrasyCat
Specialist III
Hello
 
   Source files located in the project's "Generated Code" folder should not be modified by the user.
   Each time you hit generate code, content of these files will get lost.
 
   Only exception is inside of interrupt function implemented in MCUInit.c, you can add code after the
   comment /* Write your interrupt code here ... */
 
CrasyCat
0 Kudos
Reply