|
|||||||||||
| 技術(shù)交流 | 電路欣賞 | 工控天地 | 數(shù)字廣電 | 通信技術(shù) | 電源技術(shù) | 測(cè)控之家 | EMC技術(shù) | ARM技術(shù) | EDA技術(shù) | PCB技術(shù) | 嵌入式系統(tǒng) 驅(qū)動(dòng)編程 | 集成電路 | 器件替換 | 模擬技術(shù) | 新手園地 | 單 片 機(jī) | DSP技術(shù) | MCU技術(shù) | IC 設(shè)計(jì) | IC 產(chǎn)業(yè) | CAN-bus/DeviceNe |
請(qǐng)教如何定義一個(gè)數(shù)組在flash中? |
| 作者:iamsxj 欄目:ARM技術(shù) |
請(qǐng)教如何定義一個(gè)數(shù)組在FLASH中?并且是付值后的。const unsigned CHAR i[]={1,2,3,4,5,6};這樣定義編譯后運(yùn)行數(shù)據(jù)不對(duì)。 |
| 2樓: | >>參與討論 |
| 作者: zlgarm 于 2006/2/10 16:20:00 發(fā)布:
re 試試這個(gè): unsigned CHAR const i[]={1,2,3}; |
|
| 3樓: | >>參與討論 |
| 作者: Chang_HS 于 2006/2/10 16:45:00 發(fā)布:
const unsigned CHAR 應(yīng)該沒有問題,是用的什么編譯器? |
|
| 4樓: | >>參與討論 |
| 作者: hotpower 于 2006/2/10 18:05:00 發(fā)布:
一個(gè)const是不行的 |
|
| 5樓: | >>參與討論 |
| 作者: iamsxj 于 2006/2/10 19:28:00 發(fā)布:
哦,謝謝,我使用的是 |
|
| 6樓: | >>參與討論 |
| 作者: iamsxj 于 2006/2/10 19:34:00 發(fā)布:
還有個(gè)問題 我使用的是ADS編譯和調(diào)試的,想請(qǐng)教高手asd如何看程序編譯出來的信息?以前我用51的,用的keil.keil編譯后會(huì)有列表文件,以及連接信息,感覺程序很容易控制,現(xiàn)在用ads感覺很不習(xí)慣,請(qǐng)問ads如何設(shè)置?把編譯結(jié)果以文件形式顯示出來?? |
|
| 7樓: | >>參與討論 |
| 作者: hotpower 于 2006/2/11 19:11:00 發(fā)布:
只會(huì)用keil,不想用ADS |
|
| 8樓: | >>參與討論 |
| 作者: hotpower 于 2006/2/12 11:04:00 發(fā)布:
code??? void KeyObj::KeyCommandExec(unsigned CHAR mode, unsigned CHAR keyval) { static PV KeyCommandTab[3][10] = {//鍵盤放事件處理表 (RAM=0x40000000) //const PV KeyCommandTab[3][10] = {//鍵盤放事件處理表 (RAM=0x40000474) //static const PV KeyCommandTab[3][10] = {//鍵盤放事件處理表(FLASH ROM=0x00002148) {&KeyObj::Key00, &KeyObj::Key01, &KeyObj::Key02, &KeyObj::Key03, &KeyObj::Key04, &KeyObj::Key05, &KeyObj::Key06, &KeyObj::Key07, &KeyObj::Key08, &KeyObj::Key09}, //鍵釋放事件處理 {&KeyObj::Key10, &KeyObj::Key11, &KeyObj::Key12, &KeyObj::Key13, &KeyObj::Key14, &KeyObj::Key15, &KeyObj::Key16, &KeyObj::Key17, &KeyObj::Key18, &KeyObj::Key19}, //壓鍵事件處理 {&KeyObj::Key20, &KeyObj::Key21, &KeyObj::Key22, &KeyObj::Key23, &KeyObj::Key24, &KeyObj::Key25, &KeyObj::Key26, &KeyObj::Key27, &KeyObj::Key28, &KeyObj::Key29} //長(zhǎng)壓鍵事件處理 }; static const等效為code???這個(gè)實(shí)踐確實(shí)不錯(cuò)!!! |
|
| 9樓: | >>參與討論 |
| 作者: hotpower 于 2006/2/12 14:27:00 發(fā)布:
給個(gè)const的2張?zhí)麍D ![]() ![]() * - 本貼最后修改時(shí)間:2006-2-12 14:31:01 修改者:hotpower |
|
| 10樓: | >>參與討論 |
| 作者: iC921 于 2006/2/12 14:35:00 發(fā)布:
這話講不通啊 “給個(gè)const的2張?zhí)麍D”,暈了你? 嘿嘿,帖貼要分清,也許你回去猜兩燈謎就清醒了,... |
|
| 11樓: | >>參與討論 |
| 作者: 云中月8888 于 2006/2/12 22:43:00 發(fā)布:
const用作全程量和局部量編譯代碼不同 全程量時(shí):const和static const編譯結(jié)果相同,數(shù)據(jù)放在rom里(FLASH里) 局部量時(shí):const數(shù)據(jù)放在ram里,static const數(shù)據(jù)放在rom里(FLASH里) |
|
| 12樓: | >>參與討論 |
| 作者: hotpower 于 2006/2/13 1:01:00 發(fā)布:
const和static const編譯結(jié)果 |
|
| 13樓: | >>參與討論 |
| 作者: hotpower 于 2006/2/13 1:02:00 發(fā)布:
const1
|
|
| 14樓: | >>參與討論 |
| 作者: hotpower 于 2006/2/13 1:04:00 發(fā)布:
const2 * - 本貼最后修改時(shí)間:2006-2-13 1:11:35 修改者:hotpower
|
|
| 15樓: | >>參與討論 |
| 作者: hotpower 于 2006/2/13 1:13:00 發(fā)布:
果然與云中月8888說得一樣 向LPCARM老鳥學(xué)習(xí)!!!
|
|
| 16樓: | >>參與討論 |
| 作者: hotpower 于 2006/2/13 1:21:00 發(fā)布:
options...
|
|
| 17樓: | >>參與討論 |
| 作者: hotpower 于 2006/2/13 1:37:00 發(fā)布:
全局的const和static const裝載位置有所不同 typedef void (* PV)(void);//一般函數(shù)指針 //inline //static PV KeyCommandTab[3][10] = {//鍵盤放事件處理表 (RAM=0x40000000) //const PV KeyCommandTab[3][10] = {//鍵盤放事件處理表 (FLASH ROM=0x000021CC) static const PV KeyCommandTab[3][10] = {//鍵盤放事件處理表(FLASH ROM=0x000021B0) {&KeyObj::Key00, &KeyObj::Key01, &KeyObj::Key02, &KeyObj::Key03, &KeyObj::Key04, &KeyObj::Key05, &KeyObj::Key06, &KeyObj::Key07, &KeyObj::Key08, &KeyObj::Key09}, //鍵釋放事件處理 {&KeyObj::Key10, &KeyObj::Key11, &KeyObj::Key12, &KeyObj::Key13, &KeyObj::Key14, &KeyObj::Key15, &KeyObj::Key16, &KeyObj::Key17, &KeyObj::Key18, &KeyObj::Key19}, //壓鍵事件處理 {&KeyObj::Key20, &KeyObj::Key21, &KeyObj::Key22, &KeyObj::Key23, &KeyObj::Key24, &KeyObj::Key25, &KeyObj::Key26, &KeyObj::Key27, &KeyObj::Key28, &KeyObj::Key29} //長(zhǎng)壓鍵事件處理 }; void KeyObj::KeyCommandExec(unsigned CHAR mode, unsigned CHAR keyval) { |
|
|
|
| 免費(fèi)注冊(cè)為維庫(kù)電子開發(fā)網(wǎng)會(huì)員,參與電子工程師社區(qū)討論,點(diǎn)此進(jìn)入 |
Copyright © 1998-2006 m.58mhw.cn 浙ICP證030469號(hào) |