Keil中的环境变量和使用

原文链接(Keil官方):Key Sequence for Tool Parameters

Use Key Sequences to pass arguments from µVision to external user programs. Key Sequences are combinations of a Key Code and a File Code. Key sequences can be used, for example, in the dialogsTools, SVCS, Options for Target — User, or from the command line. The following rules apply:

  • Certain Key Codes have to be duplicated when used from the command line.
    To use the symbols $, #, %, @, ~, ^
    escape them with $$, ##, %%, @@, ~~, ^^.
  • Enclose Key Sequences within quotes (" ") when using folder names that might contain special characters (space, ~, or #).

Key Codes and File Codes are listed in the tables below:

Key CodeDescription
%File name with extension (PROJECT1.UVPROJ)
#File name with extension and complete path specification (C:\MYPROJECT\PROJECT1.UVPROJ)
@File name without extension or path specification (PROJECT1)
$Path name of a file. Path names get extended with a backslash. For example, $P could generate C:\MYPROJECT\.
!File name with extension and relative path specification to the current folder (.\SRC\TEST.C)
~ 1Line number of the current cursor position
^ 1Column number of the current cursor position
File CodeDescription
$DDevice name as selected from the Device Database.
EEditor file name currently in focus.
F

Depending on the context, this File Code returns:

  • The file selected in the window Project.
  • The currently active editor file.
  • The file that is currently translated by a build process.
HApplication HEX file name (PROJECT1.H86).
$JAbsolute compiler system include folder. Compiler base folders are listed in the fieldProject — Manage — Project Items — Folder/Extensions - ARMCC Folder. The include path depends on the compiler selected in Options for Target - Code Generation - ARM Compiler.
KAbsolute root folder of the development toolchain, regardless of the Key Code used.
LLinker output file. Typically the executable file used for debugging (PROJECT1).
$MCPU mask revision number.
PCurrent project file name.
XµVision executable program file (..\UV4\UV4.EXE). Works for For Key Code %, # @.
$XXTAL clock frequency in MHz as specified in Options for Target — Target — XTAL.
^XXTAL clock frequency in kHz as specified in Options for Target — Target — XTAL.
File Codes when using an SVCS
Q 2Name of the temporary file that contains comments (Comment).
R 2Revision number (Revision).
C 2Check point string (Check Point).
I 2Project identification string (Project Ident).
U 2User name (User Name).
V 2Database file name string (Database).
File Codes when using a merge tool
 A merge tool gives you the opportunity to merge the application-specific configuration settings from the previous version into the current version. Specify a merge tool withTools - Configure Merge Tool.
$currentIs the file as copied from the PACK with default configuration options.
$previousIs the back-up file filename.increment number
Environment Variables

You can use environment variables for passing paths to external programs. This is described explicitly in the respective dialog documentation. Environment variables must be enclosed by curly brackets ({ }). For example, you have defined an environment variable with
SET ProgramFiles(x86)=C:\Program Files (x86).

You can use the environment variable as
{ProgramFiles(x86)} in dialog fields.

Note

  • 3
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值