• slider image 442
  • slider image 492
  • slider image 493
  • slider image 494
  • slider image 495
  • slider image 496
:::


Browsing this Thread:   1 Anonymous Users






Re: 請教MPLAB C的三維陣列 extern的寫法!!
#3
新會員
新會員


查看用戶資訊
1.基本上C18 1個section最大只到255byte,3維矩陣[10][4][8]已經超過255byte了所以一定會有錯誤,如果rom還有空間的話不妨試試看 以 (extern)const rom far unsigned char digit[10][4][8]的方式來建立,不然的話你就要去修改啟動程式(c018.c)之#pragma的分配,另外請參考 MPLAB C18 C Compiler Getting Started第7章疑難解答FAQ-8,FAQ-10,FAQ-11

2.TEST_SAMPL(digit[0]);這種呼叫方式是有問題的,矩陣一定是以指標傳址的方式傳輸,如果一定要傳單一數值的話請先將digit[0]的值傳給一個變數再以變數的方式呼叫即可

a = digit[0];
TEST_SAMPL(a);

發表於: 2006/12/1 18:44
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請教MPLAB C的三維陣列 extern的寫法!!
#2
版主
版主


查看用戶資訊
C18 無法支援三維陣列,C18 只支援到二維。

發表於: 2006/11/30 16:00
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


請教MPLAB C的三維陣列 extern的寫法!!
#1
新會員
新會員


查看用戶資訊
使用的是PIC18F8722
source files裡掛一個BUFFER.c
內容是unsigned char digit[10][4][8]= ............

Header Files裡的BUFFER.h
內容是extern unsigned char digit[10][4][8];

main的c 裡面有#include "buffer.h"了

但是組譯出現Error - section '.idata_buffer.o' can not fit the section. Section '.idata_buffer.o' length=0x00000140

另外使用的函式 TEST_SAMPL(digit[0]); 也出現Warning [2054] suspicious pointer conversion

麻煩高手教導一下正確的語法~~感激!!

發表於: 2006/11/29 19:24
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... ]

教育訓練中心

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