在Keil C51中,
uchar code MENU00[][24]={{},{},......{}}; uchar code MENU01[][24]={{},{},......{}}; uchar code MENU02[][24]={{},{},......{}}; uchar code MENU03[][24]={{},{},......{}}; ........................................ uchar code MENU30[][24]={{},{},......{}};
定义以上数组在程序空间,再用程序空间的指针MENU指向 以上各数组:
code uchar code *MENU[]={ MENU00,MENU01,MENU02........MENU30};
这样程序实现起来很方便.在KeilkC51中可以编译通过.
但在ICCAVR6.31A中实现以上的结构, #Pragma data:code const uchar MENU00[][24]={{},{},......{}}; const uchar MENU01[][24]={{},{},......{}}; const uchar MENU02[][24]={{},{},......{}}; const uchar MENU03[][24]={{},{},......{}}; ........................................ const uchar MENU30[][24]={{},{},......{}};
const uchar *const MENU[]={ MENU00,MENU01,MENU02........MENU30};
#Pragma data:data 却不能通过编译, 是否ICCAVR不支持这种指针方法,是否有其它办**?
ICC报错为: invalid initialization type; found `pointer to array 18 of const unsigned char' expected `pointer to unsigned char'
|