cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
vytautas
Explorer
Explorer
5,871 Views
Registered: ‎10-01-2007

error: incompatible types in assignment

Hallo.

I'm working with MicroBlaze 9.1.

In my project variables are float type:

float * MaxGradM[image_height][image_width];

(pointer)

i locate this printer to DDR RAM:

for (i=0;i<image_height;i++){ 

    MaxGradM[i][0] = (float *)((DDR_BASEADDR+7*DDR_SHIFT)+ (i+1)*DDR_SHIFT_40);
}

 And if I try to assign some value, i got an error:

..... 

MaxGradM[i][j]=1.0; 

.....

error: incompatible types in assignment

Here is not a soluton too... 

MaxGradM[i][j]=(float)1.0;

Please help me, how to solve this error??

Thanks 

 

Best Regards,
Vytautas
0 Kudos
Reply
3 Replies
vsiva
Xilinx Employee
Xilinx Employee
5,868 Views
Registered: ‎01-18-2008

you have an array of float *'s. And you are assigning a float value to a float pointer.
0 Kudos
Reply
vytautas
Explorer
Explorer
5,862 Views
Registered: ‎10-01-2007

I want to assign MaxGradM array to DDR RAM. In for loop do I this correct? Then if I have to change zero values of MaxGradM cells to 1 I must do followings??:

(float *) MaxGradM[i][j]=1; 

 

Best Regards,
Vytautas
0 Kudos
Reply
vytautas
Explorer
Explorer
5,841 Views
Registered: ‎10-01-2007

I understud now. Realy I impose address on  my Pointer (0x1200*****) and then I write a value (*(float *) pointer = new_value;)

No errors, I think it will work :) 

 

Best Regards,
Vytautas
0 Kudos
Reply