如何在freescale banked区域操作一个变量
1个回答
展开全部
首先,我们要在.c中定义一个变量:
#pragma DATA_SEG __RPAGE_SEG PAGED_RAM /* the description of PAGED_RAM is in prm file */
unsigned char banked_var;
#pragma DATA_SEG DEFAULT
接着,我们同样在.h中声明这个变量:
#pragma DATA_SEG __RPAGE_SEG PAGED_RAM /* the description of PAGED_RAM is in prm file */
extern unsigned char banked_var;
#pragma DATA_SEG DEFAULT
这样,我们就可以使用这个变量了。
#pragma DATA_SEG __RPAGE_SEG PAGED_RAM /* the description of PAGED_RAM is in prm file */
unsigned char banked_var;
#pragma DATA_SEG DEFAULT
接着,我们同样在.h中声明这个变量:
#pragma DATA_SEG __RPAGE_SEG PAGED_RAM /* the description of PAGED_RAM is in prm file */
extern unsigned char banked_var;
#pragma DATA_SEG DEFAULT
这样,我们就可以使用这个变量了。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询