最近偶然發現keil MDK Configuration Wizard的功能




在keil MDK自帶的啓動代碼有一個優勢就是可視化的配置選項,就是Configuration wizard選項,這樣就省去了我們手動輸入配置的問題。比如下面對於fm3.systeam.h的設計的Configuration界面:

 而在啓動代碼中的這個Configuration的程序爲:

可以看出,圖形化的Configuration語句放在了程序的註釋上。具體的語法如下:

Item Text Description
<h> yes Heading: the following options belong to a group.
<e> yes Heading with Enable: the following options belong to a group, which can be enabled via a checkbox.
<e.4> yes Heading with Enable: modifies a specific bit (bit 4, in this example).
</h> or </e> yes Heading or Enable end.
<i> yes Tool-tip help for previous item.
<q> yes Option for bit values which can be set via a checkbox.
<o> yes Option with selection or number entry.
<o.4..5> yes Modify a range of bits (example: bit 4 to 5).
<o.4> yes modify a single bit (example: bit 4).
<s> yes Option with ASCII string entry.
<s.10> yes Option with ASCII string entry and a size limit of 10 characters.
Modifier   Description
<0-31> no Value range for option fields.
<0-100:10> no Value range for option fields with step 10.
<0x40-0x1000:0x10> no Value range in hex format and step 10.
<0=> yes Value and text for selection.
<#+1>   <#-1>
<#*8>   <#/3>
no value modification (add, sub, mul, div) before number is merged into field.

另外還有一個重要的一點:如果想要顯示Configuration Wizard,

必須在代碼文本的頭100行之內有如下命令:

// <<< Use Configuration Wizard in Context Menu >>> 

另外在還有一個可選的命令表示Configuration Wizard的結束:

// <<< end of configuration section >>> 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章