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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

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

2,692 次查看
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
 
标签 (1)
0 项奖励
回复
2 回复数

964 次查看
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 项奖励
回复

964 次查看
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 项奖励
回复