• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
  • slider image 488
  • slider image 491
:::


Browsing this Thread:   1 Anonymous Users




(1) 2 »


Re: 如何才可以實現自動加入 build number?
#12
資深會員
資深會員


查看用戶資訊
參考一下
Predefined symbols like __DATE__, __TIME__ in MPASM?
http://forum.microchip.com/tm.aspx?m=360969

發表於: 2009/1/9 16:44
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 如何才可以實現自動加入 build number?
#11
資深會員
資深會員


查看用戶資訊
哦~~~~~~
不好意思,小弟要的是組語...,看來是不能用了。

發表於: 2009/1/9 15:35
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 如何才可以實現自動加入 build number?
#10
中級會員
中級會員


查看用戶資訊
根據 Jason680 的建議, 我昨天不到5分鐘就弄好了, 跑得很好啊



#define VERSION 1.0

//---------------------------------------------------------------------------
void getVersionString(char *buf)
{
sprintf(buf, "%04.2f (%s %s)", VERSION, __DATE__, __TIME__);
}
//---------------------------------------------------------------------------
main()
{
char version[36];
...
getVersionString(version);
...
}

發表於: 2009/1/9 13:02
曾經 狂奔 舞蹈 貪婪的說話, 隨著冷的 濕的 心腐化

個人的休閒小站
歡迎來參觀
http://www.elevior.com
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 如何才可以實現自動加入 build number?
#9
資深會員
資深會員


查看用戶資訊
typhoon大大
小弟才書學淺...Orz...,找不到你說修改的地方。

發表於: 2009/1/9 11:33
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 如何才可以實現自動加入 build number?
#8
資深會員
資深會員


查看用戶資訊
在 makefile 裡面 all 的部分,強制執行某 script 去修改 *.h 的內容……應該可以用。

先說這方法我沒實際試過,所以如果成功的話,請記得通知一聲唷。

發表於: 2009/1/8 22:13
The Answer to Life, the Universe, and Everything.
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 如何才可以實現自動加入 build number?
#7
資深會員
資深會員


查看用戶資訊
請問組語也有辦法使用嗎?

發表於: 2009/1/8 21:15
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 如何才可以實現自動加入 build number?
#6
資深會員
資深會員


查看用戶資訊
"不支援"是乎說不太過去.....不太合常理!!!
1. __DATA__, __TIME__ 是compiler當下才決定的值,
於執行時期而言是"常數"(定值).
2. MPLAB C compiler所在環境(windows OS)都有支援date,time

以下網頁,找到資料,希望有用
http://forum.microchip.com/printable.aspx?m=240043
If you are using the MPLAB C18 compiler, here is what you can write:

// Insert date & time at program location 0xF000
#pragma romdata some_known_location = 0xF000
const rom char CDATE[] = {__DATE__};
const rom char CTIME[] = {__TIME__};
#pragma romdata

發表於: 2009/1/8 20:10
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 如何才可以實現自動加入 build number?
#5
版主
版主


查看用戶資訊
C30 是 ANSI C 的基本支援,無法像 PC 的 compiler 有那麼多的支援。
查了一下 C30 User's Guide 有關_DATE_的說明 :

What are the definitions for __ DATE __ and __ TIME __ respectively, when the date and time of translation are not available? (ISO 6.8.8)

Not applicable. The compiler is not supported in environments where these functions are not available.

發表於: 2009/1/8 11:05
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 如何才可以實現自動加入 build number?
#4
中級會員
中級會員


查看用戶資訊
哇~ 好像是不錯的建議 (舉大姆指)

發表於: 2009/1/8 9:58
曾經 狂奔 舞蹈 貪婪的說話, 隨著冷的 濕的 心腐化

個人的休閒小站
歡迎來參觀
http://www.elevior.com
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 如何才可以實現自動加入 build number?
#3
資深會員
資深會員


查看用戶資訊
考慮用__DATE__跟__TIME__如何!!

發表於: 2009/1/7 16:47
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------