Re: C30 VARIABLE TO BE PLACED IN PROGRAM MEMORY
|
||||
---|---|---|---|---|
新會員
|
sir:
針對data 放在ram 是這樣寫,但存在ROM 好像不是,user guide 有如下說明 The MPLAB C30 compiler does not directly support accessing variables in program space. Variables so allocated must be explicitly accessed by the programmer, usually using table-access inline assembly instructions, or using the program space visibility window 但我不知如何coding
發表於: 2008/9/26 15:48
|
|||
|
Re: C30 VARIABLE TO BE PLACED IN PROGRAM MEMORY
|
||||
---|---|---|---|---|
版主
|
陣列長度是你自己指定的長度大小你是知道的,ANSI C 有計算字串長度的函數。
"陣列每個位置資料" 這是最基本的陣列使用: my_const_array[0] 就會指到第一個資料的位址,my_const_array[9] 就會只到最後的資料。此外也可以用指標方式: const char *ptr; ptr=my_const_array; 將 ROM 的陣列起始位址傳給ㄧ指向 ROM 得指標 data = * ptr++;
發表於: 2008/9/26 11:33
|
|||
|
C30 VARIABLE TO BE PLACED IN PROGRAM MEMORY
|
||||
---|---|---|---|---|
新會員
|
請問16bit MCU,若陣列資料存在program memory,如下
const __attribute__((space(auto_psv))) char my_const_array[10] = "Help"; 語法如何宣告將此my_const_array陣列指標傳至另一函數 及如何取出此陣列長度和陣列每個位置資料?
發表於: 2008/9/26 11:02
|
|||
|