IAR开发STM8,如何加入每次编译的日期时间信息来做为版本信息

IAR开发STM8,如何加入每次编译的日期时间信息来做为版本信息呢??

网上找打了这个:

--------

IAR USING PRE- AND POST-BUILD ACTIONS


Using pre-build actions for time stamping


If necessary, you can specify pre-build and post-build actions that you want to occur before or after the build. 


The Build Actions dialog box—available from the Project menu—lets you specify the actions required.
For more information about the Build Actions dialog box, see Build actions options, page 215.


Using pre-build actions for time stamping


You can use pre-build actions to embed a time stamp for the build in the resulting binary file. Follow these steps:
1 Create a dedicated time stamp file, for example, timestamp.c and add it to your project.
2 In this source file, use the preprocessor macros __TIME__ and __DATE__ to initialize a string variable.
3 Choose Project>Options>Build Actions to open the Build Actions dialog box.
4 In the Pre-build command line text field, specify for example this pre-build action:


cmd /c "del "$OBJ_DIR$\timestamp.o""


在网上找了半天,终于找到了,

http://blog.chinaunix.NET/uid-30127490-id-5062415.html

IAR的宏定义:


const char MenuStr[]={"T1xxxxxxxxxxP-xxE##"__DATE__"#####"};  //定义字符串常量

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值