如下错误
a value of type "int *" cannot be assigned to an entity of type "int (*)[256][256]" Ana3_FM_BUS_data_DA9708in_AD9280 main.c line 92 1481038925261 260
a value of type "int *" cannot be assigned to an entity of type "int" Ana3_FM_BUS_data_DA9708in_AD9280 main.c line 155 1481038925262 262
expression must be a modifiable lvalue Ana3_FM_BUS_data_DA9708in_AD9280 main.c line 129 1481038925261 261
程序如下
int *souraddr,*deminaddr,*DAout_addr;
int (*FM_cos)[256][256];
Uint16 i,j,k,n,m,n1;
float pi;
main(void)
{
//Uint32 key1,key2;
//Uint16 i;
FM_cos=(int *)0x40000;
/*初始化CSL库*/
CSL_init();
/*EMIF为全EMIF接口*/
CHIP_RSET(XBSR,0x0a01);
/*设置系统的运行速度为48MHz*/
PLL_config(&myConfig);
pi=3.141593;
DAout_addr = (int *)(0x4ffff);
// deminaddr = (int *)0x40fff;
for(n=0;n<256;n++)
{
for(m=0;m<(256-n);m++)
{
FM_cos[n][m]=(int)(255*(1+cos(2*pi*m/(256-n))));// 由(sin8b92[i]-127)*j/127+127 变换得到
}
}
for(i=0;i<(256-k);i++) //输出频率28.333KHz
{
GPIO_FSET(IODATA,IO0D,0); //调ping波形输出 同一个data BUS 收发会相互影响,导致采样不准确 舍去此方法
*DAout_addr = FM_cos[k][i];
GPIO_FSET(IODATA,IO0D,1);
}
Shine:
从错误信息看是指针的问题。
你定义的二维数组指针不大对。请参考下面的用法。http://c.biancheng.net/cpp/html/79.html
yuan chen2:
回复 Shine:
应该这样定义 int *FM_cos[256];