打印
[STM8]

【转】IAR开发STM8,如何加入每次编译的日期时间信息来做...

[复制链接]
967|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
风萧寒|  楼主 | 2016-11-27 13:15 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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__"#####"};  //定义字符串常量


发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

68

主题

134

帖子

3

粉丝